使用prototype.js时,IE8中的"对象预期"Javascript错误

ano*_*ard 4 javascript internet-explorer object-expected prototypejs internet-explorer-8

function icPageInit()
{
    $("icImgDiv" + icAlternate()).setOpacity(0);
    return true;
}
window.onload = icPageInit;
Run Code Online (Sandbox Code Playgroud)

这段Javascript代码在Firefox和Chrome中运行良好,但在Internet Explorer 8中出现错误"Object Expected"失败.IE8表示错误发生在上面代码的第3行.

有谁知道为什么会这样,和/或如何让它工作?

ano*_*ard 13

弄清楚了.

如果你使用的任何其他比原来的Internet Explorer扼流圈"javascript"language的属性script标签.

我用附加到版本号javascriptlanguage属性,这是导致不IE加载prototype.js.