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