b.js file code:
var script = document.createElement("script");
script.src = "a.js";
document.body.appendChild(script);
Why does this load the a.js file asynchronously? If the code in the b.js file has not been executed yet, but the a.js file has been loaded, should we execute the code in a.js or continue to execute b. What about the rest of the code in js?
I don’t quite understand, please give me some advice
三叔2017-07-05 10:51:55
Execute a.js first and then continue to execute the remaining code of b.js. This is a sequential loading execution form.