js/jquery禁止页面回退

$(function() {
    //防止页面后退
    history.pushState(null, null, document.URL);
    window.addEventListener('popstate', function () {
        history.pushState(null, null, document.URL);
    });
})    

  

猜你喜欢

转载自www.cnblogs.com/OuZeBo/p/10250314.html