[whatwg] Link.onload

Boris Zbarsky bzbarsky at MIT.EDU
Sun Mar 15 07:06:45 PDT 2009


Sean Hogan wrote:
>> This is a request for the link element to be given an onload attribute.
>>   
> And presumably a readyState property.

At least in Gecko, you can already detect whether the sheet is done 
loading: if you try to get its cssRules and that throws 
INVALID_ACCESS_ERR, then it's still loading.  (If it throws 
DOM_SECURITY_ERR then you're not allowed to read the style data; that's 
why you have to check for the exact type of exception thrown.  Though 
really, if you're loading style sheets cross-site you're in for a world 
of hurt unless you control both sites.)

-Boris



More information about the whatwg mailing list