js location.replace()

来源:互联网 发布:淘宝怎么修改手机号 编辑:程序博客网 时间:2024/06/06 15:02

location.replace('b.html') 作用是将当前页的浏览器记录替换成b.html(就是将history对象url列表中的最后一个更改成b.html)

例如在a.html跳转(用location.replace)到b.html中,history对象url列表中最后一个浏览记录是b.html,如果在b.html中使用location.replace()跳转到c.html中,那么history对象中的url列表就是 c 而a和b.html会消失

原创粉丝点击