怎么样防止你的网站文章和图片被非法复制,保存,拷贝? 用以下方法,可以一定程度上对窃取者造成麻烦,防止别人轻易不劳而获抄袭你的网页内容。

网页防盗用的方法之一:禁止右键,禁止任何被选中拷贝和粘贴。

<body topmargin=”0″ leftmargin=”0″ bgcolor=”#ffffff” oncontextmenu=’return false’ ondragstart=’return false’ onselectstart =’return false’ onselect=’document.selection.empty()’ oncopy=’document.selection.empty()’ onbeforecopy=’return false’ onmouseup=’document.selection.empty()’>

说明
oncontextmenu=’return false’ 禁止鼠标右键
ondragstart=’return false’ onselectstart =’return false’ onselect=’document.selection.empty()’ oncopy=’document.selection.empty()’ onmouseup=’document.selection.empty()’禁止选取
onbeforecopy=’return false’ 禁止拷贝


网页防盗用的方法之二是:不禁止右键,只是禁止右键图像另存为。

在HEAD区加
<meta http-equiv=”imagetoolbar” content=”no”>

在BODY区加

<script language=”javascript”>
function Click(){
if(window.event.srcElement.tagName==”IMG”)
{
window.event.returnValue=false;
}
}
document.oncontextmenu=Click;
</script>

网页防盗用的方法之三:只在网页上禁止拷贝和粘贴功能。

<body self.event.returnValue=false onselectstart=”return false”>

网页防盗用的方法之四:只在某幅特定图片上禁止使用图片工具/右键功能。

禁止使用图片工具:<img src=”EXAMPLE.jpg” width=”300″ height=”300″ galleryimg=”no”>
禁止右键功能:<img src=”EXAMPLE.jpg” width=”300″ height=”300″ oncontextmenu=”return false”>

网页防盗用的方法之五:禁止浏览器缓存。

先在HEAD区加入以下代码
<!– MICROSOFT/NETSCAPE/MOZILLA BROWSERS 都需加入以下标签G –>
<meta http-equiv=”Pragma” content=”no-cache”>

<!– MICROSOFT BROWSERS 还需加入以下标签 –>
<meta http-equiv=”Expires” content=”-1″>

再在</body>和</html>加入以下代码
</body>
<!– 加入额外的HEAD代码 –>
<head><meta http-equiv=”Pragma” content=”no-cache”></head>
</html>

网页防盗用的方法之六:禁止某类浏览器访问你的网页。

例如禁止Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1) Opera 7.54
可在HEAD区的JAVA部分加入以下代码:
if(navigator.userAgent.match(/Opera/ig)) {
location.replace(”opera-not-supported.html”);
}

网页防盗用的方法之七:永远都会带着框架来隐藏你网页的真实地址。

<script language=”javascript”><!–
if (window == top)top.location.href = “frames.htm”; //frames.htm为框架网页
// –></script>

网页防盗用的方法之八:防止被人frame嵌入别的网页中。

<SCRIPT LANGUAGE=javascript><!–
if (top.location != self.location)top.location=self.location;
// –></SCRIPT>

网页防盗用的方法之九:网页加密及图像加水印。

前面几种方法都只能对付不太精通电脑的人。更有效的保护你的网页的办法还是对你的网页加密及图像加水印。