async
,defer
Classic scripts may specify
defer
orasync
, but must not specify either unless thesrc
attribute is present.For classic scripts, if the
async
attribute is present, then the classic script will be fetched in parallel to parsing and evaluated as soon as it is available (potentially before parsing completes). If theasync
attribute is not present but thedefer
attribute is present, then the classic script will be fetched in parallel and evaluated when the page has finished parsing. If neither attribute is present, then the script is fetched and evaluated immediately, blocking parsing until these are both complete.The
defer
attribute may be specified even if theasync
attribute is specified, to cause legacy web browsers that only supportdefer
(and notasync
) to fall back to thedefer
behavior instead of the blocking behavior that is the default.
type
The default, which is used if the attribute is absent, is "
text/javascript
".