首页 > 其他 > 详细

禁止浏览器返回登入页面

时间:2018-07-09 17:00:09      阅读:357      评论:0      收藏:0      [点我收藏+]

目前很多项目都没有特意做这个处理,就是浏览器返回到登入页面,然后点击下一页箭头,可以进入,但是如果有这个需求只需要在禁止的那个页面,输入如下代码即可

<script>
        $(document).ready(function (e) {
            var counter = 0;
            if (window.history && window.history.pushState) {
                $(window).on(popstate, function () {
                    window.history.pushState(forward, null, #);
                    window.history.forward(1);
                    // alert("不可回退");  //如果需在弹框就有它
                    self.location="index.html?v="+version; //如查需要跳转页面就用它
                });
            }
     
            window.history.pushState(forward, null, #); //在IE中必须得有这两行
            window.history.forward(1);
        });
    </script>  

 附加一个FQ软件:https://my.ishadowx.net/#

禁止浏览器返回登入页面

原文:https://www.cnblogs.com/ldlx-mars/p/9284624.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!