Location.replace() MethodNameLocation.replace() Method---replace one displayed document with anotherAvailabilityNavigator 3.0 Synopsis
location.replace(url) Arguments
ReturnsNothing. DescriptionThe replace() method of the Location object loads and displays a new document. Loading a document in this way is different than simply setting location or location.href in one important respect: the replace() method does not generate a new entry in the History object. When you use replace(), the new URL overwrites the current entry in the History object. After calling replace(), that is, the browser's Back button will not return you to the previous URL; it will return you to the URL before that one. UsageWhen you are working with multiple frames and/or JavaScript generated documents, you sometimes end up with quite a few temporary or transient documents. If there are more than just a few of these documents, it becomes annoying to the user to back out of your web site with the Back button. If you use the replace() method to load these documents, however, you can prevent this problem. |
|