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

[whatwg] Link.onload

From: Boris Zbarsky <bzbarsky@MIT.EDU>
Date: Sun, 15 Mar 2009 13:41:54 -0400
Message-ID: <49BD3DE2.1090506@mit.edu>
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 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 30 January 2013 18:47:49 GMT