《精通javascript》中的几个错误
第86页,代码清单5-28中有这样一段:
//向后遍历数组,
//因为我们向前添加元素
for ( var i = elems.length - 1; i >= 0; i-- ) {
parent.insertBefore( elems[i], before );
}
此处用一个反循环反而把被添加元素的顺序搞反了,用一个正循环才能得到正确的顺序。
另一个错误:在103页,表单事件那部分有这样一句:“select事件在<select>元素更新后触发”。事实上,<select>元素更新后只会触发onchange事件,不会触发onselect事件,参见这里:“Broadly speaking, buttons can generate click events, and text and select items can generate focus, blur, select, and change events. The one potentially confusing aspect of this organization of events is that selection lists cannot generate the select event. This is because they have no editable text. ”
I think that is an interesting point, it made me think a bit. Thanks for sparking my thinking cap. Sometimes I get so much in a rut that I just feel like a record.
online banking with fifth third
3 Apr 10 at 12:25 am
Thanks for some quality thoughts there. I am kind of new to web surfing, so I printed this off to put in my file, any better way to go about keeping track of it then printing?
Short sale in San Diego
24 Apr 10 at 2:16 pm
Hey, I think your very on track with this, I can’t say I totally agree , but its not really that much of a deal .
ship a car
12 Jun 10 at 1:07 pm