Window location.replace()
描述
replace()
方法用一個新文件替換當前文件。
另請參閱
注意
assign() 和 replace() 的區別
replace() 會從文件歷史記錄中移除當前 URL。
使用 replace() 時,無法使用“後退”按鈕導航回原始文件。
語法
location.replace(newURL)
引數
引數 | 描述 |
newURL | 必需。 要導航到的頁面的 URL。 |
返回值
無 |
瀏覽器支援
location.replace()
在所有瀏覽器中都受支援
Chrome | Edge | Firefox | Safari | Opera | IE |
是 | 是 | 是 | 是 | 是 | 是 |