[whatwg] Link.onload

Garrett Smith wrote:
> On Sun, Mar 15, 2009 at 12:07 AM, Jonas Sicking <jonas at sicking.cc> wrote:
>> link.onload = function() {
>>  displayDialog("Dialog Title", someObject);
>> }
> 
> Why not implement EventTarget on link? For example:
> 
> link.addEventListener('load', displayDialog, true);

It's the same thing.  <link> already implements EventTarget; the only 
question is what events are dispatched, not how one listens to them.

> What happens if dialog.css has:
> 
>  @import "panel.css"
>   /* other rules */

Then the load event for the <link> would not fire until the panel.css 
file has finished loading, I would hope!

-Boris

Received on Sunday, 15 March 2009 10:41:54 UTC