Window location.replace() method
- Föregående sida reload()
- Nästa sida sök
- Åter till föregående nivå 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()
You cannot use the 'Back' button to navigate back to the original document.
Syntax
location.replace(newURL)
Parameter
Parameter | Description |
---|---|
newURL | Required. The URL of the page to navigate to. |
Return value
None.
Browser support
All web browsers support location.replace()
:
Chrome | IE | Edge | Firefox | Safari | Opera |
---|---|---|---|---|---|
Chrome | IE | Edge | Firefox | Safari | Opera |
Stöd | Stöd | Stöd | Stöd | Stöd | Stöd |
- Föregående sida reload()
- Nästa sida sök
- Åter till föregående nivå Window Location