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

[whatwg] Questions about script attributes in HTML5

From: Aryeh Gregor <Simetrical+w3c@gmail.com>
Date: Wed, 28 Jul 2010 13:44:18 -0400
Message-ID: <AANLkTi=R8+-QmsgkQ454BHFw7V_ffy6J3mfmTO_7DuDR@mail.gmail.com>
On Wed, Jul 28, 2010 at 1:20 PM, zhao Matt <mattzhaoweb at gmail.com> wrote:
> Quote:
> "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
> interchangeable?)

No.  It just means that you can specify both, like <script async defer
src="myscript.js"></script>.  In this case, "async" takes precedence
and "defer" is ignored in conforming browsers.

> Quote:
> "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,? :)? )

Yes.  I don't know why defer isn't allowed here -- maybe someone else
knows the answer.
Received on Wednesday, 28 July 2010 10:44:18 UTC

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