HTML Standard attribute: async
[this page | pdf | back links]
The HTML async attribute indicates if a script
is to be executed asyncronously. It applies to <script>
elements. It only in practice applies to external scripts, so should only be
used if the src attribute is
also present.
The async and
defer attributes
work in tandem as follows:
-
If async
is present then the (external) script is executed asynchronously with the rest
of the page (with the script being executed while the page continues to be
parsed)
-
If async is not present but
defer
is present then the (external) script is executed when the page has finished
parsing
-
If neither async or defer is present then the (external) script
is fetched and executed immediately, before further parsing of the page
Valid
attribute
values (when used with <script>
elements) include:
Value
|
Description
|
async
|
Script should be
executed asyncronously
|
NAVIGATION LINKS
Contents | Prev | Next | HTML Attributes