html 禁止浏览器后退

 在禁止后退的页面直接添加下面的js代码即可,详情可参考https://blog.csdn.net/baidu_23275675/article/details/83054949

//防止页面后退
history.pushState(null, null, document.URL);
window.addEventListener('popstate', function () {
    history.pushState(null, null, document.URL);
});

猜你喜欢

转载自blog.csdn.net/baidu_23275675/article/details/83054829