Replace()

The replace property allows a new document to be loaded and removes the replaced document from the browser history list, (removing it from the list of urls the Back button uses to navigate backwards).

window.location.replace("nextpage.htm")

Example one shows the normal procedure, example two shows the replace() procedure

Example OneExample Two

Page Two of example two contains the following:

<a href="page3.htm" onclick="window.location.replace(this.href)">Go To Page Three</a>

Click Here to try example one in a new browser window.

Click Here to try example two in a new browser window.