Re: ISSUE-36: DOMContentLoaded?

Le Mon, 06 Mar 2006 11:38:52 +0200, Jonas Sicking <jonas@sicking.cc> a  
écrit:

>
<...>
>>  I don't think we should say that all scropts have to be loaded since a  
>> proper implementation of the defer attribute could build the DOM before  
>> loading all scripts.
>
> The more I think about it the more I think it might be a good idea to  
> require all scripts to be loaded. Without that we might be severly  
> reducing the usefulness of the event by forcing too many users to wait  
> for "load" to fire in order to reliably use functions and global  
> variables provided in scripts.
>
> There might also be issues with current implementations would load all  
> scripts before firing the event, so users might become dependent on it  
> anyway.
>
> / Jonas
>

This is an interesting problem, and no matter what behaviour will be  
picked some web devs still won't be happy.

The safest way would be to fire the event when all scripts have been  
loaded, because if no JS has been loaded, but the content was loaded and  
parsed into the DOM... then that's useless - there's no JS to catch the  
event. The other case, as you said, is ... a script might catch the event  
but some functions and global variables can be missing and thus break the  
execution.

In this case DOMContentLoaded is not an appropriate event name.  
DOMScriptsLoaded perhaps.


-- 
http://www.robodesign.ro
ROBO Design - We bring you the future

Received on Monday, 6 March 2006 12:05:25 UTC