HTML CSS Reference/HTML Attributes Reference/defer

Материал из Web эксперт
Перейти к: навигация, поиск

"defer" Example

<html>
<head>
<SCRIPT LANGUAGE="Javascript" defer="false">
function returnIslandRootName()
{
  var islandRoot = document.all["mySrc1"].XMLDocument;
  alert(islandRoot.nodeName);
}
</SCRIPT>
<SCRIPT LANGUAGE="XML" id="mySrc1">
<offerings>
 <class><materials>This should render.</materials><time>1.5
hr</time></class>
</offerings>
</SCRIPT>
</head>
<body>
<button onclick="returnIslandRootName()">Test the XML Data Island</button>
</body>
</html>



defer is applied to

+----------------+--------------------------------------------------------------+
| Applied_To     |<script>                                                      |
+----------------+--------------------------------------------------------------+



"defer" Syntax and Note

Note:
    
Determine whether the script in the <script> is executed while the page is 
loading or if it is deferred until after the page loads. 
This is a Boolean attribute.
Possible values are false and true.
Default value is false.
    
Syntax:
    
<script defer="value"> . . . </script>