Chapter I.
Load and Execute
When a browser executes JavaScript code, it cannot do anything else at the same time (a single process), which means that every time the <script> tag appears, the page is arbitrarily parsed and executed with scripts (each file must wait until the previous file has been downloaded and executed before the download is started). So the head of the JS and CSS to render the page, interactive behavior (almost all) JS on the <body> bottom;
The script tag is placed at the bottom of the page before the </body> closes, ensuring that the page finishes rendering before it executes
Reduce the number of external chain scripts will improve performance (merge JS)
Any web site can use a URL that merges the file to be processed to get any number of files.
can use a variety of non-blocking download JS method
Defer property can delay script (only IE4 and FF3.5 support)
Dynamically create script to download and execute
Use the Xhr object to download the JS code and inject the page
High-performance JavaScript reading notes-1