W3C home > Mailing lists > Public > www-html@w3.org > July 2013

Clarification on `async` and `defer` together

From: Stu Cox <stuart.cox@gmail.com>
Date: Sun, 7 Jul 2013 14:59:36 +0100
Message-ID: <CAJ-2Ov4Zt7MioELFtOMVb3KP2t9_CMcUHcOmkbZst525dZ7Brw@mail.gmail.com>
To: www-html@w3.org
Not entirely sure if this is the right reference doc:
http://www.w3.org/TR/html-markup/script.html  but it doesn't make it clear
what should happen if both `async` and `defer` attributes are set on a
`<script>` element:

<script src="myscript.js" async defer>

Browsers all seem to give `async` precedence, and I agree that this is the
most desirable behaviour, however logically `async` and `defer` aren't
necessarily mutually exclusive. If both were applied, it might be
reasonable to assume the behaviour might match that of `defer` alone.

Could a note be added to this / any other relevant docs highlighting this

The WHATWG spec [1] suggests this behaviour, but isn't incredibly clear
about it either.

Received on Sunday, 7 July 2013 14:00:34 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 15:06:26 UTC