Script merging can improve JavaScript performance effectively, and here's a good example, you can refer to the following
Page rendering is blocked for each <script> tag initial download, so reducing the number of <script> tags included in the page helps to improve the situation. This is not just for outside-chain scripting, but the number of inline scripts is also limited. When the browser parses an HTML page, every time a <script> tag is encountered, a delay is caused by the execution of the script, so minimizing the delay time will significantly improve the overall performance of the page. Typically a large web site or network application relies on several JavaScript files. You can combine multiple files into one so that you can reduce performance consumption by simply referencing a <script> tag. File merging can be done either offline packaging tools or a real-time online service like Yahoo!combo handle. Code as follows: <!--optimization before:--> <html> <head> <title>script example</ title> </head> <body> <p>hello world!</p> <script type= "http:/ /yui.yahooapis.com/combo?2.7.0/build/yahoo/yahoo-min.js "></script> <script type=" http:// Yui.yahooapis.com/combo?2.7.0/build/event/event-min.js "></script> </body> </html > <!--optimization:--> <html> <head> <title>script example</ title> </head> <body> <p>hello world!</p> <script src= "http:// Yui.yaHooapis.com/combo?2.7.0/build/yahoo/yahoo-min.js&2.7.0/build/event/event-min.js "type=" Text/javascript "> </script> </body> </html>