[whatwg] Link.onload

Boris Zbarsky bzbarsky at MIT.EDU
Sun Mar 15 10:41:54 PDT 2009


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




More information about the whatwg mailing list