Window location.replace() method
- Previous page reload()
- Next page search
- Go back one level Window Location
Definition and usage
replace()
The method replaces the current document with a new document.
See also:
Difference between assign() and replace():
replace()
Remove the current URL from the document history.
Use replace()
Cannot navigate back to the original document using the 'Back' button.
Syntax
location.replace(newURL)
Parameter
Parameter | Description |
---|---|
newURL | Required. The URL of the page to navigate to. |
Return value
None.
Browser support
All browsers support location.replace()
:
Chrome | IE | Edge | Firefox | Safari | Opera |
---|---|---|---|---|---|
Chrome | IE | Edge | Firefox | Safari | Opera |
Support | Support | Support | Support | Support | Support |
- Previous page reload()
- Next page search
- Go back one level Window Location