js禁用网页的后退功能

https://www.jianshu.com/p/c617c3f00be1

        window.history.pushState(null, null, document.URL);
        window.addEventListener('popstate',
            function(e) {
                window.history.pushState(null, null, document.URL);
        });  

 

posted @ 2018-11-28 11:02  老豆芽  阅读(146)  评论(0)    收藏  举报