《JavaScript的三种消息框alert,confirm,prompt》http://blog.csdn.net/lixiang0522/article/details/7764730程序员
JavaScript Try...Catch 语句:http://www.jb51.net/w3school/js/js_try_catch.htm数组
——————————————————————————spa
写JS报错“Cannot read property 'style' of undefined”,是什么缘由?.net
这句:code
for(var j=0; j<=aLi.length; j++){
改为:htm
for(var j=0; j<aLi.length; j++){
一、 看到报错信息 “... ‘style’ of undefined”
二、 找到出错的行 “aLi[j].style ...”
三、 马上意识到 “aLi[j]” 是 “undefined”
四、 推断数组下标越界
五、 上面一行是循环,判断循环的边界
六、 找到问题点
写多了的程序员,通常这个过程不会超过 5s。。。blog