Sam-I-Am on Web Development

Sam Foster on the web and web-ish software developmen

Saturday, June 11, 2005

is the DOM ready yet?

This post ( Order of Events @ dean.edwards.name) addresses the need for a better solution than window.onload for DOM scripting. window.onload only fires after *all* the content on a page (including images) has loaded.. which is frequently significantly after the page has appeared in the browser. Mozilla/Firefox apparenly have the little known "DOMContentLoaded" event. Very handy. Windows IE has the readyState (or, better, the also little known ondocumentready event. Take this and brothercake's domFunction and there's a cross-browser solution in there awaiting the motivated developer.

1 Comments:

At 1:23 AM, Blogger Sam-I-Am said...

Here's something I'm playing with: (DOM) runWhenReady. It includes a message stack that gets inserted asap, and further appended to as events check in.

 

<< Home