The replace()
method replaces the current document with a new one.
The difference between assign() and replace():
replace() removes the current URL from the document history.
With replace() it is not possible to use "back" to navigate back to the original document.
location.replace(
newURL)
Parameter | Description |
newURL | Required. The URL of a page to navigate to. |
NONE |
location.replace()
is supported in all browsers:
Chrome | Edge | Firefox | Safari | Opera | IE |
Yes | Yes | Yes | Yes | Yes | Yes |
截取页面反馈部分,让我们更快修复内容!也可以直接跳过填写反馈内容!