全网整合营销服务商

电脑端+手机端+微信端=数据同步管理

免费咨询热线:15165206905

如何实现网页中的文字不允许被复制

1 、在<HEAD>后加入如下内容, 即可实现简单的网页内容不允许复制的功能。但是要真正实现连“查看源代码”也不行,请参见参考文献。

<SCRIPT language=javascript> if (top.location != self.location){top.location=self.location; } </SCRIPT> 
<noscript><iframe src=*></iframe></noscript> 
<BODY oncontextmenu="return false" ondragstart="return false" onselectstart ="return false" onselect="document.selection.empty()" oncopy="document.selection.empty()" onbeforecopy="return false" onmouseup="document.selection.empty()"> 

参考文献: 

如何在网页中设置禁止查看源文件: 
http://www.gdvip.cn/data/2006/0413/article_96.htm 
家园保卫战:给你的网页加把锁 
http://www.enet.com.cn/article/2005/0310/A20050310397167_5.shtml 

2、 <script>function document.oncontextmenu(){event.returnValue=false;}//屏蔽鼠标右键</script> 

3、body属性中加

<body onbeforecopy="return false" oncontextmenu="return false" 
oncopy=document.selection.empty(2) ondragstart="return false" 
onmouseup=document.selection.empty(2) onselect=document.selection.empty(2) 
onselectstart="return false" >

4、其实只要你把网站源代码进行加密就可以
在网页里加入下面的代码<BODY oncontextmenu="return false" onselectstart="return false"
ondragstart="return false" 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 onmousedown="helpor_net()">


你要是有精力 看看下面的 代码:
禁止另存网页
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.onmousedown = norightclick; // for all others
//-->
</s cript>

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

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

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


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

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

6、使用包含页面
加密所包含页面地址,使用工具 htmlguardian5.3.5
目前功能最强的html代码加密软件,可以保护连接和html代码被盗。1.锁右键。2.禁鼠标圈选。3.不允许离线使用。4.密码保护。5.不显示状态栏url地址。6.全代码或 局部代码保护。7.链接跟踪。8.禁止打印(IE5+)。9.压缩代码( 未加密前)。10.可加密*.html *.js *.asp *.vbs。11.两种不同加密算法。12.加密 frameset 结构。13.某些功能支持几个不同版本的浏览器

您的项目需求

*请认真填写需求信息,我们会在24小时内与您取得联系。