If you are reading this, you are probably having problems with “document.body.onload” in your IE javascript code. I have had this problem a few days back and a Google search solved it.
To fix it, just change your code from:
document.body.onload = alert("Hello world");
to:
document.onload = alert("Hello world");
It appears that document.body.onload does not work on IE. Before, when I loaded the page, I used to get the error dialog “A Runtime Error has occured” saying “Error: Not implemented“. On debug in Visual Studio, I’d get “htmlfile: Not implemented“. All these error messages are not very clear, but fortunately, the faulty line of code was highlighted.
I have not yet researched about the difference(s) between document.body.onload and document.onload in Firefox (or IE), but if you’re only using a small piece of javascript code, you should be alright with this fix.

Posted in
Tags: 





