js禁止浏览器页面刷新|js禁止浏览器页面后退功能的实例(推荐)

时间:2021-08-14  来源:浏览器  阅读:
<script>
 $(function(){
   if(window.location.href.indexOf("/login") > -1) {
    //防止页面后退
     history.pushState(null, null, document.URL);
     window.addEventListener("popstate", function () {
      history.pushState(null, null, document.URL);
     });
   }
 });
</script>

js禁止浏览器页面刷新|js禁止浏览器页面后退功能的实例(推荐)

http://m.bbyears.com/bangongshuma/135898.html

推荐访问:js清除浏览器缓存 js判断浏览器类型
相关阅读 猜你喜欢
本类排行 本类最新