When using prototype.js, “Objects expected” JavaScript error in IE8

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

This Javascript code works well in Firefox and Chrome, but the error “Object Expected” failed in Internet Explorer 8. IE8 said The error occurs on line 3 of the code above.

Does anyone know why this happens, and/or how to make it work?

figured it out.

If in the language of the script tag Using anything other than “javascript” in the property will cause Internet Explorer to choke.

I use the version number attached to javascript in the language property, which causes IE to not load prototype.js.< /p>

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

This Javascript code works well in Firefox and Chrome, but it fails with the error “Object Expected” in Internet Explorer 8. .IE8 indicates that the error occurred on line 3 of the code above.

Does anyone know why this is happening, and/or how to make it work?

I figured it out.

If you use anything other than “javascript” in the language attribute of the script tag, then Will cause Internet Explorer to choke.

I use the version number appended to javascript in the language attribute, which causes IE to not load prototype.js.

p>

Leave a Comment

Your email address will not be published.