禁用浏览器前进后退,不允许页面中的元素选中和拖拽;

// 禁止浏览器的前进后退
        history.pushState(null, null, document.URL);
        window.addEventListener('popstate', function () {
            history.pushState(null, null, document.URL);
        });
        //禁止拖动
        document.ondragstart=function() {return false;}


        //禁止网页元素被拖动和选中
         <body  oncontextmenu="return false;" onselectstart="return false">



猜你喜欢

转载自blog.csdn.net/weixin_34849724/article/details/80697418