-1) {//防止页面后退history.pushState(null, null, document.URL);window.addEventListen; 更新日期:2025/11/13">
(编辑:jimmy 日期: 2025/11/13 浏览:2)
实例如下所示:
<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禁止浏览器页面后退功能的实例(推荐)就是小编分享给大家的全部内容了,希望能给大家一个参考,也希望大家多多支持。