JAVASCRIPT
VUE
REACT
NODE
ES6
TYPESCRIPT

Js阻止页面回退

2020. 08. 04    

JS阻止页面回退

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