判断HTML页面是点击历史返回打开,还是正常
1 回答

吃鸡游戏
TA贡献1829条经验 获得超7个赞
window.onpageshow=function(e){
var a=e||window.event;
if(a.persisted){
window.location.href= window.location.href;
}
}
a.persisted 如果是正常打开的html页面值为false
如果是通过历史返回,或者浏览器回退打开时值为true
- 1 回答
- 0 关注
- 1085 浏览
相关问题推荐
添加回答
举报
0/150
提交
取消