Script async Property
Find out if a script was executed asynchronously as soon as it was available:
Definition and Usage
The async property sets or returns whether a script should be executed asynchronously as soon as it is available, or not.
This property reflects the async attribute of the <script> tag.
Note: The async attribute is only for external scripts (and should only be used if the src attribute is present).
Note: There are several ways an external script can be executed:
- If async is present: The script is executed asynchronously with the rest of the page (the script will be executed while the page continues the parsing)
- If async is not present and defer is present: The script is executed when the page has finished parsing
- If neither async or defer is present: The script is fetched and executed immediately, before the browser continues parsing the page
The numbers in the table specify the first browser version that fully supports the property.
Return the async property:
Set the async property:
Specifies whether a script should be executed asynchronously as soon as it is available, or not
|Return Value:||A Boolean, returns true if the script is executed asynchronously as soon as it is available, otherwise it returns false|
HTML reference: HTML <script> async attribute
❮ Script Object