September 26, 2005

Window.onload Fixed

Dean Edwards does it again. He’s fixed the window.onload problem for Firefox and IE.

What is the window.onload problem you ask? A fair enough question. window.onload fires after the page is loaded, allowing developers to init their applications. But if you have a big page, or lots of images, or just a slow connection, you have to wait until the thing loads fully. See Deans sample page showcasing the solution. See? A fast call to your application, while the page is still loading. So very nice.

To solve this Dead “discovered” an undocumented Firefox feature called DOMContentLoaded. How he found this, I dunno. But it’s solid, and does what he needs. IE doesn’t do this though. IE has an attribute called defer that Dean relies upon, and now call use these two functions to solve the problem. This should have huge implications on the Web 2.0.

Post Info

Tagged As Big Ideas, Coding, Javascript, Reference, Tip

Comments are Open (0)

Posted at 08:25 AM

Post a comment

(If you haven't left a comment here before, you may need to be approved by the site owner before your comment will appear. Until then, it won't appear on the entry. Thanks for waiting.)

Search
Comments on this post
Categories
Info
Tony Stephens
Copyright © 1995-2005
Site Version:
10
Licensed:
Creative Commons
Validate:
XHTML, CSS, 508, RSS
Subscribe
Blog-Fu, Link-Fu