看阿信的转载
http://expert.csdn.net/Expert/topic/2176/2176029.xml?temp=.8189813

解决方案 »

  1.   

    2.注意document.all等集合对象的引用位置
    我对这个不是很理解
      

  2.   

    document.all是不标准的过时语法,在ie以外的浏览器上不支持.
      

  3.   

    用document.getElementById( "elementId" ) 代替 document.all
    跨Browser
      

  4.   

    1.慎用eval
    A.使用0s
    for(var i = 0; i < 100;i++)
    {
    var ti2 = new Date()
    }
    B.使用15s
    for(var i = 0; i < 100;i++)
    {
    var b =eval("new Date()")
    }废话没有人会这么用eval的,一般用eval的都是没法直接定义的