August 26, 2008

speed up Javascript

As it turns out, .innerHTML and .firstChild.nodeValue both do almost the same thing, however .innerHTML is not w3c standard and takes 2x as long to run on all the major browsers.

The differences: innerHTML works in IE 4, however using nodeValue, it seems you need IE6 or newer. This shouldn't be a problem. Certain special charters print differently with the two, so test your code before switching.

No comments: