HTML and CSS Reference
In-Depth Information
Table 10.14 Methods of the location Object
What It Does
Reloads the current URL.
Replaces the current page with a new one.
Removes a watch point on the location property.
Sets a watch point on the location property; that is, calls a function if the
property changes.
Two methods of interest (see Table 10.14) are replace() and reload() . The replace()
method is used to change the location of the current page; that is, to point to another
page. It is similar to the href property, but where href puts the new page at the top of the
history list, the replace() method removes the current page from the history list and
replaces it with the new page. The reload() method behaves like the browser's Reload
button. It causes the window's current document to be reloaded.
Loading a New Page into a Frame with the location Object. In Example 10.20,
the location object changes the location of the current page. By selecting a Web site, the
user is taken to that site, which is displayed in the bottom frame of a frameset.
(The file defining the framesets called framefile.html)
<frameset rows="130,*" frameborder="yes" border="8"
<frame src="location.html" scrolling="no">
<frame src="emptyframe.html" >
(The empty file that will be the bottom frame called emptyframe.html)
<title>Empty Frame</title>
Search WWH ::

Custom Search