网页防止后退,禁止点击左上角的

网页防止后退,禁止点击左上角的<

   <script language="javascript">
        //防止页面后退
        history.pushState(null, null, document.URL);
        window.addEventListener('popstate', function () {
            history.pushState(null, null, document.URL);
        });
    </script>

注:程序写完后找bug,一定注意浏览器网址,容易出现Bug

猜你喜欢

转载自blog.csdn.net/qq_40910788/article/details/84795592