很多時候,我們不希望自己的網頁內容被別人抄襲或者復制走,那么我們該如何防復制呢?
最牛的防復制代碼1:(將此代碼粘貼到body中可以有效防選中防復制和防鼠標右鍵)
<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>最牛的防復制代碼2:(將此代碼粘貼到body中可以有效防選中防復制和防鼠標右鍵)
<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>1.將徹底屏蔽鼠標右鍵
oncontextmenu="window.event.returnvalue=false"<table border oncontextmenu=return(false)><td>no</table> //可用于Table2.取消選取、防止復制
<body onselectstart="return false">3.不準粘貼
onpaste="return false"4.防止復制
oncopy="return false;" oncut="return false;"5.防止被人frame
<SCRIPT LANGUAGE=javascript><!-- if (top.location != self.location)top.location=self.location; // --></SCRIPT>6.網頁將不能另存為
<noscript><iframe src="/blog/*.html>";</iframe></noscript>7.改變連接是狀態欄的顯示內容
<a href="http://www.tao2t.com" onMo ... ;window.status='輸入連接狀態欄顯示內容’;return true">8.禁止網頁中目標對象被下載(如圖片)
下面的代碼將幫助你禁止網頁中目標對象被下載:
<a href="javascript:void(0)" onMouseDown="alert('對不起!圖片不能下載!')"><img src="圖片地址" alt="" /></a>9.頁面禁止刷新完全,最好在pop出來的窗口里用,沒工具欄的
<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>總結了這么多款,總有一款 網站網頁常用的防復制代碼 適合你哦以上就是網站網頁常用的防復制代碼的全部內容,希望對大家的學習和解決疑問有所幫助,也希望大家多多支持武林網。新聞熱點
疑難解答