You usually get this using an Internet Explorer version 6 (but also later versions might exibit this) on pages that seem to be loading ok in the background. You press ok and the page disappears and the regular error page is displayed.

What is happening is that javascript is trying to change a html element that has not finished loading. The usual cause of this problem is an embedded script block that executes as it loads, rather than on the onload event of the page.

The fix is easy. Take all the scripts that execute as they load and either mark them as defer or encapsulate those commands in a function that is executed on the onload event of document.body. Be careful with defer. This post describes the various implementations of the keyword in various browsers.

Comments

Siderite

<p>As I said, the solution is simple for someone who adds javascript to a site. It's their job :) If they don't know much about javascript, they should not use it.<br><br>A simple solution is this:<br>- add <br><b>function startFunction() {</b><br>before all these embedded javascript blocks<br>- add<br><b> }<br>window.onload=startFunction;</b><br>after them. It is far more elegant and safe to use an <i>addHandler</i> option, but if it is a simple site and you don't know javascript, that should do it.</p>

Siderite

Sturdy

<p>But isn't there a solution, a patch or fix, those unfamiliar with java script and code could use? This problem seemed to start when I installed IE8, then uninstalled it, not sure about that though. I've read numerous sites about this issue and a simple answer I've yet to see.</p>

Sturdy

Siderite

As I said, the solution is simple for someone who adds javascript to a site. It&#39;s their job :) If they don&#39;t know much about javascript, they should not use it.<br><br>A simple solution is this:<br>- add <br><b>function startFunction() {</b><br>before all these embedded javascript blocks<br>- add<br><b> }<br>window.onload=startFunction;</b><br>after them. It is far more elegant and safe to use an <i>addHandler</i> option, but if it is a simple site and you don&#39;t know javascript, that should do it.

Siderite

Anonymous

But isn&#39;t there a solution, a patch or fix, those unfamiliar with java script and code could use? This problem seemed to start when I installed IE8, then uninstalled it, not sure about that though. I&#39;ve read numerous sites about this issue and a simple answer I&#39;ve yet to see.

Anonymous

Post a comment