Using the script tag in the page to introduce JavaScript file (<script type= "Text/javascript" src= "JS file Address" ></script>), when the browser renders the page, When a SCRIPT element is read, the browser does not process its contents in HTML or XHTML, and the browser notifies the browser's scripting engine to take over the contents of the script element.
the Type property of the script element defines the scripting type, which is type:
1.text/ecmascript (means parsing this script in ECMAScript manner, which is based on the ECMA-262 scripting standard)
2.text/jscript (which is a variant of the ECMAScript language implemented by Microsoft in IE), which means parsing the script in JScript mode
3.text/vbscript
4.text/vbs
(3, 4 representations are handled in the form of Microsoft VBScript, which is a completely different scripting language)
the Language property of the script element (the previous script tag uses its properties to resolve browser compatibility issues):
<script type= "Text/javascript" src= "A.js" language= "javascript1.2" ></script>
Language defines the browser version that supports the script (that is, the code in the A.js file is executed if the browser supports javascript1.2)
The defer property of the SCRIPT element:
<script type= "Text/javascript" src= "A.js" language= "javascript1.2" defer= "defer" ></script>
The Defer property is set to "defer", which means that the script does not generate any document content, so the browser can process the rest of the page ahead of time, processing the script part when the page is finished and ready to display.
Where the script tag is placed in the page.
There is a limit to the amount of resources loaded by the browser from the same domain name, so when you add a script to the head element, the first load will be a script, followed by the remainder of the document. Why is it that putting the SCRIPT element tag with the introduction of JavaScript in the head may cause the browser to delay the display of the rest of the page? The main reason is that the document.write method may be called in the script to modify the Dcument object.
Location reference for JavaScript script Storage learning address: http://www.cnblogs.com/ddyq/archive/2012/03/06/2382816.html
Reference: the JavaScript Learning Guide
(To be perfected)
The script tag in JS