利用js实现网页禁止后退

<script language="javascript">
        //防止页面后退
        history.pushState(null, null, document.URL);
        window.addEventListener('popstate', function () {
            history.pushState(null, null, document.URL);
        });
</script>

  

posted @ 2017-07-20 21:10  鄒成立  阅读(310)  评论(0编辑  收藏  举报