试了网上不少的js禁止浏览器后退的代码,发现只有下面的一种效果还是可以的。

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

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-01-27
  • 2021-12-08
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-05-21
  • 2021-07-17
  • 2022-12-23
  • 2022-01-22
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案