• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 8. Using window and frame Method... > Window Loading and Unloading

Window Loading and Unloading

As you know, you have to be careful in JavaScript about accessing page elements that have not yet been loaded. For example, trying to write to the <BODY> of a page from the <HEAD> might cause problems, because the body might not be loaded yet:

<HTML> 
    <HEAD> 
        <TITLE> 
            Writing to a Web page 
        </TITLE> 
        <SCRIPT LANGUAGE="JavaScript">
					<!--
					document.write("Hello!")
					// -->
					</SCRIPT> 
    </HEAD> 

    <BODY> 
        <H1>Writing to a Web page</H1> 
    </BODY> 
</HTML> 


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint