To fix it, just change your code from:
document.body.onload = alert("Hello world");
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.