[whatwg] Script-related feedback
whatwg at souders.org
Sat Jul 24 18:25:29 PDT 2010
"Defer" doesn't achieve the desired behavior. The goal is "load this
script after everything else in the page is done". Instead, defer'ed
scripts get loaded immediately, thus stealing one of the few network
connections from other (more important) resources.
Here's an example:
Notice that although the script is "defer" it gets loaded before the
images. (The load time of the script is displayed at the bottom and is
typically 200-500ms. However, each image takes 2000ms to download. If
the script was truly deferred it should be downloaded some time >
2000ms. Since it's loaded earlier, it steals a network connection and
causes one of the images to download later.)
On 7/23/2010 1:27 PM, Ian Hickson wrote:
> On Wed, 17 Mar 2010, Steve Souders wrote:
>>> Given that it is possible to do this from script, how common is it for
>>> people to do it from script? If it's very common, that would be a good
>>> data point encouraging us to do this sooner rather than later.
>> 6 of the top 10 US web sites load scripts after the load event: eBay,
>> Facebook, Bing, MSN.com, MySpace, and Yahoo.
> Do we know why they do this rather than use defer="", and whether
> defer="" would handle their use casess?
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the whatwg