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.
Copy Code code as follows:
before <!--optimized:-->
<title>s Cript example</title>
<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>
<!--optimized:-->
<title>script example</title >
<body>
<p>hello world!</p>
<script src= "Http://yui.yahooap Is.com/combo?2.7.0/build/yahoo/yahoo-min.js&2.7.0/build/event/event-min.js "type=" Text/javascript "></ Script>
</body>