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

Chapter 7. Using window and frame Properties > Properties of the window Object

Properties of the window Object

As we know, the window object is the big cheese of browser objects, corresponding to the browser window and containing, among other objects, the document, location, and history objects. Those objects are available through properties of the same name in the window object; for example, we’ve already seen how to navigate the browser to a URL the user types using the location object—which is part of the window object—like this (this is Listing 04-06.html on the web site—more on the location object in Chapter 10, “Using the navigator, location, and history Objects”):

<HTML> 
    <HEAD> 
        <TITLE> 
            Navigate to an URL 
        </TITLE> 
        <SCRIPT LANGUAGE = "JavaScript"> 
            <!--
            function Jump() 
            { 
                window.location.href = document.form1.text1.value 
            } 
            // --> 
        </SCRIPT> 
    </HEAD> 

    <BODY> 
        <H1>Navigate to an URL</H1> 
        <FORM NAME = "form1"> 
            <BR> 
            <INPUT TYPE = TEXT NAME="text1" SIZE = 80> 
            <BR> 
            <BR> 
            <INPUT TYPE = BUTTON Value="Navigate to URL" ONCLICK="Jump()"> 
        </FORM> 
    </BODY> 
</HTML> 

					  


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


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