Thursday, October 6th, 2005
The window.onload event is used by programmers to kick-start their web applications. This could be something trivial like animating a menu or something complex like initialising a mail application. The problem is that the onload event fires after all page content has loaded (including images and other binary content). If your page includes lots of images then you may see a noticeable lag before the page becomes active. What we want is a way to determine when the DOM has fully loaded without waiting for all those pesky images to load also.
He discusses solutions the involve:
- Mozilla’s DOMContentLoaded handler
- Conditional Comments (<!–[if IE]><script defer src=”ie_onload.js”></script><![endif]–>)
- Conditional Compilation (/*@if (@_win32) … */)
I still bet that most people put script tags at the bottom of their body ;)
Posted by Dion Almaer at 10:51 am