W3C home > Mailing lists > Public > whatwg@whatwg.org > March 2007

[whatwg] Apply script.defer to internal scripts

From: Matthias Bauer <moeffju@moeffju.net>
Date: Thu, 29 Mar 2007 12:58:13 +0200
Message-ID: <460B9BC5.2080802@moeffju.net>
On 29.03.2007 11:33 Anne van Kesteren wrote:

 > On Thu, 29 Mar 2007 11:30:36 +0200, Gareth Hay <gazhay at gmail.com> wrote:
 >> Does it not follow that to be "more consistent, logical, better style,
 >> whatever." you should wrap your code in a function that is called 
onload?
 >>
 >> Isn't that what onload is for? being triggered after the page has 
loaded?
 >
 > That load event dispatched on the <body> element also waits for all
 > external scripts and images to be loaded. This is not always desirable.

What about the DOMContentLoaded event? It is supported by Mozilla and, 
apparently, Opera 9. Dean Edwards has a technique to make it work on IE, 
and jQuery supports it on Safari [1].

Is there any chance DOMContentLoaded will be part of HTML5?

-Matt
Received on Thursday, 29 March 2007 03:58:13 UTC

This archive was generated by hypermail 2.3.1 : Monday, 13 April 2015 23:08:33 UTC