也是查找了好多资料才找到的,这种方式,可以消除 后退的所有动作。包括 键盘、鼠标手势等产生的后退动作。

    <script language="javascript">
        //防止页面后退
        history.pushState(null, null, document.URL);
        window.addEventListener('popstate', function () {
            history.pushState(null, null, document.URL);
        });
    </script>

       现在,我们项目中就使用了第三种方式。在常用浏览器中,都可以禁用了后退。

 

http://blog.csdn.net/zc474235918/article/details/53138553

 

上一个历史记录链接 去除
history.replaceState({}, window.location.href, "<c:url value='/sys/gotoSettings'/>")
history.replaceState({}, "", newUrl)

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-10-11
  • 2021-05-15
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-01-22
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案