W3C home > Mailing lists > Public > whatwg@whatwg.org > February 2010

[whatwg] should async scripts block the document's load event?

From: Brian Kuhn <bnkuhn@gmail.com>
Date: Sat, 13 Feb 2010 12:52:10 -0800
Message-ID: <335a812d1002131252v3bef6892y4714e29ad63e4e12@mail.gmail.com>
FWIW, loading scripts asynchronously with the "Script DOM Element" approach
does not block window.onload in IE.  In Chrome and Safari, the downloading
blocks, but execution doesn't.  In Firefox and Opera, downloading and
execution blocks.

So, it's pretty hard to say what web developers would expect with async
scripts.  I know that they will like having things like ads and analytics
not block window.onload though.  At the very least, we need that ability to
make that happen.



On Sat, Feb 13, 2010 at 12:15 PM, Boris Zbarsky <bzbarsky at mit.edu> wrote:

> On 2/13/10 9:29 AM, Darin Fisher wrote:
>
>> The Mozilla network code uses the phrase "load background" to describe a
>> load that happens asynchronously in the background _and_ does not block
>> onload.  Perhaps not coincidentally, this mode is used to load
>> background images :-)
>>
>
> It used to be.  It's not anymore, because it was not compatible with what
> other UAs did or with web developer expectations.  At this point the
> background mode is only used for async XHR, and then only because background
> modes don't make the throbber spin.  Otherwise we wouldn't use it for
> anything at all.
>
> Which is my real worry about making any loads that don't block onload:
> would web developers expect them to?
>
> -Boris
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.whatwg.org/pipermail/whatwg-whatwg.org/attachments/20100213/256ad524/attachment.htm>
Received on Saturday, 13 February 2010 12:52:10 UTC

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