时间:2021-07-01 10:21:17 帮助过:8人阅读
实例如下所示:
- <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禁止浏览器页面后退功能实例详解的详细内容,更多请关注Gxl网其它相关文章!