禁用浏览器后退

Others 2018-03-21 03:53:36 2018-03-21 03:53:36 2247 次浏览
 <script language="javascript">
        //防止页面后退
        history.pushState(null, null, document.URL);
        window.addEventListener('popstate', function () {
            history.pushState(null, null, document.URL);
        });
    </script>