async="async"
attribute of a <script>
tag in HTML, What does it mean?
<script async="async" src="...."></script>
Can be see used here for example
The async attribute is a boolean attribute. When present, it specifies that the script will be executed asynchronously as soon as it is available. Note: The async attribute is only for external scripts (and should only be used if the src attribute is present).
Asynchronous code: Scripts are loaded and executed parallelly in one go, wherein scripts are loaded concurrently as other web page components. Asynchronous scripts do not wait for other functions or statements to be executed.
Defer attribute is useful when script is using for DOM manipulations. Means script will apply on document html. async attribute: It will download the script file and execute without wait the end of html parsing. In other words, It will not guarantee all the scripts will execute after the html parsing.
And according to Steve Souders site, "the main benefit of this [async attribute] is it tells the browser that subsequent scripts can be executed immediately – they don't have to wait for ga. js".
If the async attribute is set on an external script (one with src=), browsers that support it will download that script in the background without blocking the rest of the content on the page. The script will execute whenever it is finished downloading.
http://dev.w3.org/html5/spec/Overview.html#attr-script-async
As I mentioned in a comment, setting async=true, async=false or async=anything all mean the same thing. They enable the async behavior. The only way to make a script non-async is to completely omit the attribute.
http://dev.w3.org/html5/spec/Overview.html#boolean-attributes
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With