Location replace() Method
Replace the current document:
Try it yourself »
Definition and Usage
The replace() method replaces the current document with a new one.
The difference between this method and assign(), is that replace() removes the URL of the current document from the document history, meaning that it is not possible to use the "back" button to navigate back to the original document.
Tip: Use the assign() method if you want to load a new document, and the option to navigate back to the original document.
The replace() method is supported in all major browsers.
|newURL||String||Required. Specifies the URL of the page to navigate to|
|No return value.|
Thank You For Helping Us!
Your message has been sent to W3Schools.