Javascript Reference
Categories: SCRIPT

javascript SCRIPT defer

@March 15, 2008, 1:22 a.m.
deferFirefox/Netscape/NN 6 IE 4 Chrome/Safari/DOM 1  

Read/Write  

Specifies whether the browser should proceed with rendering regular HTML content without looking for the script to generate content as the page loads. This value needs to be set in the script element's tag at runtime. When this property is set to true by the addition of the DEFER attribute to the tag, the browser does not have to hold up rendering further HTML content to parse the content of the script element in search of document.write( ) statements. Changing this property's value after the document loads does not affect the performance of the script or browser. Although Netscape 6 implements the property, it is not functional.

 
Example
 
if (document.getElementById("myScript").defer = = "true") {
    ...
}
 
Value

Boolean value: true | false.

 
Default

false


Powered by Linode.