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

[whatwg] Link.onload

From: Greg Houston <gregory.houston@gmail.com>
Date: Sat, 14 Mar 2009 15:48:07 -0500
Message-ID: <29ae901a0903141348o54d305a3h5753f4542a1c5925@mail.gmail.com>
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.

Currently I am using XMLHttpRequests to grab the stylesheets first
since XHR has a success callback, and then appending the stylesheets
to the document.head relying on the browser using the cached
stylesheet. This seems to work for the most part, but really there are
no guarantees.

There are other odd workarounds but none of them as straightforward,
elegant, and easy to use as the link elements simply having an onload

Thank you for your consideration.

Greg Houston
Received on Saturday, 14 March 2009 13:48:07 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:59:10 UTC