一、如何禁止复制
在网站的开头加段代码
<script language="JavaScript">
window.ClearEvent=function(){event.cancelBubble=false;var sSrcTagName=event.srcElement.tagName.toLowerCase();
return (sSrcTagName=="textarea" || sSrcTagName=="input" || sSrcTagName=="select");}
window.ClearKey=function(){event.cancelBubble=false;var iKeyCode=event.keyCode;return !(iKeyCode==78 && event.ctrlKey);}
with (window.document){oncontextmenu=onselectstart=ondragstart=window.ClearEvent;onkeydown=window.ClearKey;}
</script>
二、如何破解网站禁止
把下面这段代码复制到地址栏里,回车,确定,看看发生了什么,再厉害的禁止都没用了。碰到不能复制或下载的网页我都是这招解决的。
javascript:alert(document.onselectstart = document.oncontextmenu = document.onmousedown = document.onkeydown = function(){return true;});
本文介绍了一种通过JavaScript代码禁用网页上的复制功能的方法,并提供了解决方案来破解这种禁用设置,使得用户能够重新进行选择和复制操作。
3188

被折叠的 条评论
为什么被折叠?



