JS 禁止页面后退

<script type="text/javascript">
    window.history.pushState(null,null,document.URL);
    window.addEventListener('popstate',function (e) {
        history.pushState(null,null,document.URL);
    })
</script>

 

posted @ 2022-03-12 22:49  鲨鱼大王  阅读(115)  评论(0编辑  收藏  举报