[whatwg] Questions about script attributes in HTML5
mattzhaoweb at gmail.com
Wed Jul 28 10:20:26 PDT 2010
"The async and defer attributes are boolean attributes that indicate how the
script should be executed."..."The defer attribute may be specified even if
the async attribute is specified"
Do it mean 'async' is equivalent to 'defer'? (namely, are the two attributes
I personally consider the two attributes are different. The reason is as
ASYNC tells the browsers to run the script with its following content at the
SAME time(namely, asynchronously).
DEFER tells the browsers to run the script LATER, and to run the following
content first(the browsers will run the script until the page is ready).
"The defer and async attributes must not be specified if the src attribute
is not present."
Do it mean "if the src attribute is not present, the defer and async
attributes can be not used" ? (English is not my native language, :) )
However, I saw the defer attribute can work on both in-line and external
scripts . In short, when the src attribute is not present, the defer
attributes can be used.
Could you give some expanations or tips? thanks
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the whatwg