Answer the question
In order to leave comments, you need to log in
Why doesn't defer work?
Async.js is included
on the page :
<script type="text/javascript" src="async.js" async></script>
var script = document.createElement("script");
script.src = "defer.js";
script.defer = true;
script.type = "text/javascript";
document.head.appendChild(script);
Answer the question
In order to leave comments, you need to log in
For the advanced reader who knows that tags<script>
can be added to a page at any time using javascript itself, note that scripts added this way behave just like async. That is, they are executed as soon as they are loaded, without preserving the relative order.
If you need to preserve the order of execution, that is, add several scripts that will be executed strictly one after the other, then the script.async = false property is used.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question