js操作history
-
pushState
pushState只會在當前history中添加一條記錄,並不會刷新瀏覽器 history.pushState({}, "my title", "/test.html") -
replaceState
replaceState會替換當前的history中的記錄,並且刷新瀏覽器 history.replaceState({}, "my title", "/test.html") -
跳轉
history.go(1) 前進一個頁面 history.go(-1) 后退一個頁面 -
navigator
獲取用戶瀏覽器相關信息 console.log(navigator)
