js禁用右键、F5、后退

寻技术 JS脚本 / JAVA编程 2023年07月08日 64
<script language="javascript">

		//屏蔽F5
		$(document).ready(function() {
			$(document).bind("keydown",function(e){
			e=window.event||e;
			if(e.keyCode==116){
				e.keyCode = 0;
				return false;
			}
			});
		});
	
        //防止页面后退
        history.pushState(null, null, document.URL);
        window.addEventListener('popstate', function () {
            history.pushState(null, null, document.URL);
        });
    </script>
<body oncontextmenu="return false" ondragstart="return false" onselectstart="return false" onpaste="return false">

禁用右键、选择、复制、粘贴


关闭

用微信“扫一扫”