1. When the web page is loading, the js file references in the page code (as shown below) will generate http requests to the server, because the files loaded before the body.onload event (here I call them statically loaded files) will generate http requests to the server. . In order to reduce the server's http requests, I advocate that each page has only one js file reference at most.
2. Load the file after the body.onload event (here I call it When loading a file dynamically), the browser will first search for the cache file. If the cache file does not exist, it will make an http request to the server. Therefore, I advocate dynamic loading of files, and the static loading of files before the body.onload event should be precise. short.
3. This system program is divided into single files according to functional modules, and is downloaded on demand during runtime in /source/js/system.js, instead of downloading all script program codes at once, reducing network bandwidth usage. .
4. In order to prevent encoding problems when calling js code across websites, all Chinese characters in the program are encoded with the function escape. If it is only used on a single website, you can change the encoding back to Chinese characters.
5. All functions or classes marked as "for this website's own use" are likely to be related to the data types customized in the background of this website. You can delete it.
The following is the /js/Load.js program and the comments: