js禁用后退

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

原文地址:https://www.cnblogs.com/baobeiqi-e/p/9884763.html