Here we say three ways to script optimization:
First, when we do web development, when we refer to the JS file, we will generally put the JS file in the head tag of the document, when the page load, the browser will press the order from top to bottom, when the browser encountered a script tag, it will prevent other content download, Knowing that he has retrieved the entire script will slow down the page load, so the script tag should be positioned as far as possible at the bottom of the page (just before the body ends the tag) to produce a good user experience.
Another technique for reducing page load time is to streamline custom scripts. For example, we often use the jquery.validate.min.js and Jquery.validate.js, the former is a streamlined script.
Third, reduce the number of script tags sent to clients. For any page, the browser sees the optimal number of script tags as one. To achieve this optimal number, we can use a script Consolidator to bundle multiple JS files into a single resource file. Now there are a lot of script consolidator to use, some of which are built to create files in a project, and other jobs that dynamically merge scripts to the corresponding HTTP request at run time, and for the latter, a Consolidator is recommended here: http://combres.codeplex.com/.
See more highlights of this column: http://www.bianceng.cnhttp://www.bianceng.cn/webkf/aspx/