页面表单数据重复提交,看着很烦人,之前搜索资料看的稀里糊涂,不过最后找到了一个笨方法,就是通过js写一个禁用F5的功能,下面就是这行代码

<script type="text/javascript">
            if ( window.history.replaceState ) {
                window.history.replaceState( null, null, window.location.href );
            }
</script>

放在</body>标签上方即可,之后按F5和刷新界面,就不会重复提交表单了

相关文章:

  • 2021-05-26
  • 2022-12-23
  • 2022-12-23
  • 2022-02-11
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-05
  • 2021-10-21
  • 2021-08-06
  • 2021-07-09
相关资源
相似解决方案