Defer attribute in script
If you are a person who cares about and cares about system performance, I think you should be interested in defer in the script.
The defer attribute in script is false by default. According to the descriptions in the DHTML programming guide, the defer attribute is written as follows:
Using the attribute at design time can improve the download performance of a page because the browser does not need to parse and execute the script and can continue downloading and parsing the page instead.
That is to say, if the defer attribute is added during script writing, the browser does not need to process the script immediately when downloading the script, but continues to download and parse the page, this will improve the download performance.
There are many such cases. For example, you have defined many JavaScript variables, or (. INC) has written a lot of scripts to be processed, so you may wish to add the defer attribute to these scripts to improve performance.
Example:
<Script language = "JavaScript" Defer>
VaR object = new object ();
....
</SCRIPT>
Because the default defer attribute is false, <script language = "JavaScript" Defer> explicitly declaring the defer attribute is equivalent to <script language = "JavaScript" Defer = true>
After the defer attribute is declared, you must determine whether other variables reference the variables in the defer script block. Otherwise, script errors may occur.
Combined with <body onload = "XX ()">
And
<SCRIPT defer = "Defer">
XX ();
</SCRIPT>
The JS will be executed after the page is loaded, including IFRAME loading.