利用js实现 禁用浏览器后退

来源:互联网 发布:linux所有命令 编辑:程序博客网 时间:2024/05/17 07:21

<script language="javascript">

//防止页面后退 

history.pushState(null,null, document.URL); 

window.addEventListener('popstate',function() { history.pushState(null,null, document.URL); }); 

</script>

1 0