In addition to sequential loading, is there any other way to load a certain js file first?
欧阳克2017-06-13 09:23:49
You can consider using preload/prefetch
, the usage method is as follows:
<link rel="preload" href="xx.js" as="script">
Related information:
Preload: What Is It Good For?
What should you know about Preload? Chinese translation of the above article
我想大声告诉你2017-06-13 09:23:49
The simplest way is to write the priority js file in the page and load other js files in onload.
迷茫2017-06-13 09:23:49
Little Red Book, Chapter 2, 2.1 "script" element async: Optional, indicating that the script should be downloaded immediately, but does not hinder other operations on the page. Give it a try.