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

js代码:

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

 

posted @ 2019-07-21 17:31  想看云飞却没风~  阅读(259)  评论(0编辑  收藏  举报