让自己的文章不被复制 CTRL+C

时间:2022-11-28 04:48:24
方法很多:
在网页里加入下面的代码<BODY oncontextmenu="return false" onselectstart="return false"
ondragstart="returnfalse" onbeforecopy="return false" oncopy=document.selection.empty()onselect=document.selection.empty()>
这个也可以<script language="JavaScript">
function helpor_net()
{
if (event.button==2)alert(' 仅供浏览!谢谢!\n\n若有问题请与我联系! ')
}
</script>

然后把<body> 改为 <body


你要是有精力 看看下面的 代码:
禁止另存网页
1、禁止另存为
<NOs cript><IFRAME SRC=-.html></IFRAME></NOs cript>
加入HEAD里

2、禁止右键
<body oncontextmenu="return false">

<s cript language="Javas cript">
<!--

if (window.Event)
document.captureEvents(Event.MOUSEUP);

function nocontextmenu()
{
event.cancelBubble = true
event.returnvalue = false;

return false;
}

function norightclick(e)
{
if (window.Event)
{
if (e.which == 2 || e.which == 3)
return false;
}
else
if (event.button == 2 || event.button == 3)
{
event.cancelBubble = true
event.returnvalue = false;
return false;
}

}

document.oncontextmenu = nocontextmenu; // for IE5+
document. = norightclick; // for all others
//-->
</s cript>

3、让页面文字不被选中和复制
<body onselectstart="return false">

<body oncopy=alert(’对不起,禁止复制!’);event.returnvalue=false;>

4、锁定状态栏文字防止显示地址
<body onmouseover="self.status=’文字’;return true">


5、禁止图片下载
在<body......>这里的最后加入:
oncontextmenu="return false" ondragstart="return false" onselectstart="return false" scroll="auto"

6、禁止缓存
<meta http-equiv="Expires" CONTENT="0">
<meta http-equiv="Cache-Control" CONTENT="no-cache">
<meta http-equiv="Pragma" CONTENT="no-cache">
加在HEAD里