Re: Reasoning behind the async attribute

On Fri, 10 Jul 2009, Henri Sivonen wrote:
>
> It seems to me that async is a new thing and isn't describing existing 
> behavior. Correct?

Yes.


> I searched the obvious places and couldn't find a discussion leading to 
> its addition. Why was it added and does it have implementor interest?

The use case is including scripts with the following properties:

 * They load as quickly as possible
 * They don't slow down the loading of anything else
 * They are in the markup

For example, analytics scripts need to load as quickly as possible (the 
longer they are delayed, the more information they miss), but they must 
not delay the rest of the page (since that would affect the user 
experience and could in fact result in the metrics changing). "defer" was 
originally intended for this use case, but since its behaviour was never 
well-defined, it ended up being implemented in a way that doesn't address 
these needs.

-- 
Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'

Received on Monday, 27 July 2009 22:25:07 UTC