网页常用的防复制代码
2014-06-13 14:59
141 查看
<script type="text/javascript">document.body.oncontextmenu=document.body.ondragstart= document.body.onselectstart=document.body.onbeforecopy=function(){return false;}; document.body.onselect=document.body.oncopy=document.body.onmouseup=function(){document.selection.empty();};</script>
<script language="JavaScript"> document.oncontextmenu=new Function("event.returnValue=false;"); document.onselectstart=new Function("event.returnValue=false;"); </script>
<body leftmargin="2" topmargin="0" marginwidth="0" marginheight="0" oncontextmenu="return false" ondragstart="return false" onselectstart ="return false" onselect="document.selection.empty()" oncopy="document.selection.empty()" onbeforecopy="return false" onmouseup="document.selection.empty()"> <noscript><iframe src="/blog/*>";</iframe></noscript>
oncontextmenu="window.event.returnvalue=false" <table border oncontextmenu=return(false)><td>no</table> //可用于Table
<body onselectstart="return false">
onpaste="return false"
oncopy="return false;" oncut="return false;"
<SCRIPT LANGUAGE=javascript><!-- if (top.location != self.location)top.location=self.location; // --></SCRIPT>
<noscript><iframe src="/blog/*.html>";</iframe></noscript>
<a href="http://www.toyean.com" onMo ... ;window.status='输入连接状态栏显示内容’;return true">
<a href="javascript:void(0)" onMouseDown="alert('对不起!图片不能下载!')"><img src="图片地址" alt="" /></a>
<body onkeydown="KeyDown()" onbeforeunload="location=location" oncontextmenu="event.returnValue=false"> <script language="Javascript"><!-- function KeyDown(){ if ((window.event.altKey)&& ((window.event.keyCode==37)|| (window.event.keyCode==39))){alert("请访问我的主页"); event.returnValue=false; } if ((event.keyCode==8)||(event.keyCode==116)){//屏蔽 F5 刷新键 event.keyCode=0; event.returnValue=false; } if ((event.ctrlKey)&&(event.keyCode==78)){ //屏蔽 Ctrl+n event.returnValue=false; } if ((event.shiftKey)&&(event.keyCode==121)){ //屏蔽 shift+F10 event.returnValue=false; } } </script> </body>