通过js禁用浏览器的回退事件

js代码:

<script>
history.pushState(null, null, document.URL);
window.addEventListener('popstate', function () {
    history.pushState(null, null, document.URL);
});
</script>

猜你喜欢

转载自www.cnblogs.com/YeHuan/p/11221927.html