1. Properties:
1.1.async: Optional, indicates that the script is loaded immediately, but does not interfere with other actions on the page, such as downloading other scripts.
Instance:
<! DOCTYPE html>"UTF-8"> <title></title> [email protected]163. com time: .-Geneva- -Description: Put content here-<script type="Text/javascript" Async="Async"Src="Test1.js"></script> <script type="Text/javascript" Async="Async"Src="Test2.js"></script> </body>Note: There are two external script files that can be downloaded immediately without interfering with each other, and you need to ensure that there are no interdependencies between the two files
1.2 Defer: Optional, indicates deferred loading until the document is fully parsed and then executed. Useful only for external files.
Instance:
<! DOCTYPE html>"UTF-8"> <title></title> Description: Put content here-<script type="Text/javascript"Defer="defer"Src="Test1.js"></script> <script type="Text/javascript"Defer="defer"Src="Test2.js"></script> </body>
Note: In HTML5, the requirement for deferred scripting requires that the script be executed sequentially in the order in which the delay script is presented, and the first deferred script executes prior to the second deferred script. The two scripts are executed before the Domcountentloaded event. In reality, deferred scripts are not necessarily executed in the order in which they appear, nor do they precede the domcountentloaded event.
1.3 CharSet: Optional, indicates that the character set of the code specified through the SRC attribute has been ignored.
1.4 Language: Abandoned, do not dig deep.
1.5 src: Contains the external file to execute the code.
1.6 Type: optional, which represents the type of script content that is used by the writing code. Text/javascript and Text/ecmascript have not been recommended, but are based on user habits. It is still recommended, but it is not necessary to specify this property, the default value is Text/javascript
Javascript-Foundation <Script></script> Basic use