HTML CSS Reference/HTML Attributes Reference/defer

Материал из Web эксперт
Версия от 11:20, 26 мая 2010; Admin (обсуждение | вклад) (1 версия)
(разн.) ← Предыдущая | Текущая версия (разн.) | Следующая → (разн.)
Перейти к: навигация, поиск

"defer" Example

   <source lang="html4strict">

<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>

hr</class> </offerings> </SCRIPT> </head> <body> <button onclick="returnIslandRootName()">Test the XML Data Island</button> </body> </html>


     </source>
   
  


defer is applied to

   <source lang="html4strict">

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

     </source>
   
  


"defer" Syntax and Note

   <source lang="html4strict">

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>


     </source>