利用js实现禁用浏览器后退

禁用浏览器后退键的神代码:

history.pushState(null, null, document.URL)

window.addEventListener('popstate', function () {

    history.pushState(null, null, document.URL)

})

原文:点击打开链接

posted @ 2018-05-14 09:11  Mr.Kay  阅读(205)  评论(0编辑  收藏  举报