禁止浏览器返回上一页(缓存

   if(window.history && window.history.pushState){
        window.onpopstate=function(){
          window.history.pushState('forward', null)
          window.history.forward(1)
        }
      }
      window.history.pushState('forward', null)
      window.history.forward(1)
      window.history.pushState('','','')

  

 

posted @ 2023-03-30 11:21  everseven  阅读(55)  评论(0)    收藏  举报