[thelist] A question on optimization.

Joshua Olson joshua at waetech.com
Mon Mar 14 07:20:58 CST 2005

> -----Original Message-----
> From: Andrew Clover
> Sent: Monday, March 14, 2005 6:02 AM

> ... you can give the 
> browser a hint that it doesn't need to load the whole script before 
> continuing to parse the page (and load its images):
>    <script type="text/javascript" src="blah.js" 
> defer="defer"></script>
> However I believe the only browser to take advantage of this 
> possibility (AFAIK) is IE/Win.

As Andrew pointed out, using defer is a great way to force a script to be
loaded only after the page load is complete.  Compatibility across browsers
is not guaranteed, however.  You can implement your own sort of "defer" by
programmatically (through DOM) adding a script block to the head from the
body's onload handler.

Use the tenets of a Tip provided by Keith Gaughan for reference:


Best of luck,

Joshua Olson
Web Application Engineer
WAE Tech Inc.

More information about the thelist mailing list