window.history.back();//后退
window.history.forward();//前进
window.history.go(-1);//移动到指定记录点,当前倒退1,相当于window.history.forward()
window.history.length//可以了解历史中有多少个记录点
以上只是查资料时候的附带
下面来说
history.pushState与history.replaceState
history.pushState会增加一条历史记录,
history.replaceState会替换而不会增加,所以会更舒适一点。
以上就是HTML5无刷新改变当前url的详细内容,更多请关注Gxl网其它相关文章!
声明:本文来自网络,不代表【好得很程序员自学网】立场,转载请注明出处:http://haodehen.cn/did41199