Friendly Page Redirect - DHTML Lab - DHTML Diner | 3
Friendly Page Redirect
Replacing History Entries
Navigator 3.0 (yes, it was that long ago, but the method-in-question is still rarely used) introduced the replace() method of the location object. The syntax is:window.location.replace(URL string)
The page represented by the URL string argument of the replace() method, will load into the browser window and replace the current page being viewed in the history stack.
Using replace(), the diagram from the previous page would look like this:
|sorry.html replaces coolpage.html both in the browser window and the browser's history stack.
The history stack would therefore look like this:
Now, if we are viewing sorry.html and click the Back button, we will navigate to index.html, which we intuitively feel is the previous page we visited (even though it wasn't).
Produced by Peter Belesis andAll Rights Reserved. Legal Notices.
Created: Mar 21, 2000
Revised: Mar 21, 2000