zoukankan      html  css  js  c++  java
  • 禁止浏览器返回登入页面

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

    <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>  

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

  • 相关阅读:
    连续奇数
    50:数根
    38:花生采摘
    素数对
    17:字符串判等
    2702:密码翻译
    27:单词翻转
    15:整理药名
    12:加密的病历单
    09:密码翻译
  • 原文地址:https://www.cnblogs.com/ldlx-mars/p/9284624.html
Copyright © 2011-2022 走看看