Published November 17, 2007 | https://doi.org/10.59348/g9va4-vx923

IE7 Javascript - modify the DOM without crashing the browser

Creators & Contributors

One of the biggest problems faced when writing Javascript that modifies the DOM is the fact that the poorly written IE7 crashes because it hasn't finished loading the current element. This only seems to happen when the DOM is modified through a script loaded by an xx:expression binding in a style tag.

The only solution that I managed to find was to set an asynchronous timeout:

setTimeout('function()',500);

and then check if the DOM is loaded inside the function:

var ne = document.body.innerHTML;

if (ne.indexOf('LAST TEXT BEFORE BODY CLOSE TAG') == -1) {
	setTimeout('function()',500);
	return;
}

Obviously a far from ideal solution!

IE7 Javascript - modify the DOM without crashing the browser was originally published by Martin Paul Eve at eve.gd: Martin Paul Eve on November 17, 2007.

Files

10.59348_g9va4-vx923.pdf

Files (109.2 kB)

Name Size Download all
md5:a356f570d71ae3dd54ab15a6ecf01976
109.2 kB Preview Download

Additional details

Description

One of the biggest problems faced when writing Javascript that modifies the DOM is the fact that the poorly written IE7 crashes because it hasn't finished loading the current element. This only seems to happen when the DOM is modified through a script loaded by an xx:expression binding in a style tag.

Identifiers

Dates

Issued
2007-11-17T00:00:00Z
Updated
2007-11-17T13:53:06Z