This is my personal blog. The views expressed on these pages are mine alone and not those of my employer.

Wednesday, September 21, 2005

onDOMLoad

[via Keebler/Blog]

Most people attach their initialization behavior to an onload event, waiting for the page to finish loading before manipulating the DOM. One problem with this, though, is that onload doesn't fire until everything on the page is finished loading, including all images. It can take several seconds, or more, for every image to load, especially on Internet Explorer since there is a two connection per host limit.

The folks at brothercake have posted a nifty onDomLoad script that solves this problem:

"domFunction is an easy-to-use helper script, that allows other DOM scripting to run before window.onload; the practical benefit is that javascript doesn't have to wait for images or other dependencies to finish loading anymore - it can begin as soon as the DOM is ready."

Check it out.

Comments: Post a Comment

Subscribe to Post Comments [Atom]



Links to this post:

Create a Link



<< Home

This page is powered by Blogger. Isn't yours?

Subscribe to Posts [Atom]