你也没有必要使用new Array(),使用[]; 不要使用 new Number, new String, or new Boolean. 等等 不要使用new Function 来创建函数 比如你要写 代码如下: frames[0].onfocus = new Function("document.bgColor='antiquewhite'")
你应该这样写 代码如下: frames[0].onfocus = function () {document.bgColor = 'antiquewhite';};,
第二种写法可以使得编译器尽早的看到函数体。使得错误尽快的检查出来。 当你写 Js代码 代码如下: myObj = new function () { this.type = 'core'; };