I was reading about the async
attribute, which is used in the <script>
tag, and I was curious and dubious about some things.
According to the W3School :
A script that will be run asynchronously as soon as it is available
Translating:
A script that will run asynchronously as soon as it is available
I have some questions to ask about this implementation:
With the implementation of the async
attribute, I must now stop
put some scripts in <body>
of my page (as in the case of jQuery UI, which is heavy), or are things
different?
Using it may imply some performance problem or variable definitions in a certain context (for example,
if I use in jQuery
, there is some "excessive wait" to define
the variable $
as a reference to jQuery
)?
The assync
does the same thing (or at least looks like) the
definition of a callback
in window.onload
?
What are the main advantages of using it?