//禁止手机返回键 下面这段代码直接复制在index.html中,可以生效
// $(document).ready(function() {
if (window.history && window.history.pushState) {
window.addEventListener(‘popstate‘,function () {
window.history.pushState(‘forward‘, null, ‘#‘);
window.history.forward(1);
})
}
window.history.pushState(‘forward‘, null, ‘#‘); //在IE中必须得有这两行
window.history.forward(1);
// });
原文地址:https://www.cnblogs.com/rrene/p/9560757.html
时间: 2024-10-04 16:48:46