-1) { //防止页面后退 history.pushState(null, null, document.URL); window.addEventListener('popstate', function () { hist" />

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

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

实例如下所示:

<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禁止浏览器页面后退功能的实例(推荐)就是小编分享给大家的全部内容了,希望能给大家一个参考,也希望大家多多支持。

tag:推荐浏览器实例页面功能

相关内容