[whatwg] Link.onload

On Sat, Mar 14, 2009 at 1:48 PM, Greg Houston <gregory.houston at gmail.com> wrote:
> This is a request for the link element to be given an onload attribute.
>
> Often when lazy loading a plugin into an web app it is necessary for
> the plugin's stylesheets to be applied before the plugin's JavaScript
> is downloaded. Without the link element having an onload event there
> is not really a straightforward way of doing this.

This sounds like a good idea to me. Seems useful for dynamically added
stylesheets too, and possibly for stylesheets where the href attribute
is dynamically changed.

Same thing goes for the <style> element since an inline stylesheet can
have @import rules.

Garrett: Whatever we decide when it comes to the defer attribute, it
is always useful to have scripting APIs as well. There is just no way
that you can cover all use cases declaratively, so it's useful to be
able to fall back to using scripting for cases not covered.

/ Jonas

Received on Saturday, 14 March 2009 18:54:35 UTC