September 23, 1999 - Forgetting the Past
September 23, 1999|
Forgetting the Past
Tips: September 1999
Yehuda Shiran, Ph.D.
replace()method overwrites the current history entry with the specified URL. It removes the current history entry before the next URL is loaded. Removing the item from the history list also prevents users from seeing the page again by clicking on the Back button later.
This technique is very useful for online games and multi-page forms, where you want prevent the user from returning to the previous page. Furthermore, the
location.replace() method is supported by all browsers except Navigator 2.0x. The following example shows how to use this method in a link: