Dynamic load scripts can effectively improve JavaScript performance, here is a good example, you can refer to the following
With the Document Object Model (DOM), you can almost dynamically create all of the content in HTML with JavaScript. The point is that the,<script> tag does not differ from the other elements in the page: All can be moved, deleted, or even created in a document through a DOM reference. The standard Dom method makes it easy to create a new Year's <script> element: The code is as follows: <script type= "Text/javascript" > var script= Document.createelement ("script"); Script.type= "Text/javascript"; Script.src= "File1.js"; Document.getelementbytagname ("Head") [0].appendchild (script); </script> this newly created <script> element loads the File1.js file. The file starts downloading when the element is added to the page. The point of this technique is that no matter when the download is started, the download and execution of the file does not block other processes on the page. You can even place the code in the page