1.在html的body区最后加入:
<SCRIPT language=JavaScript> document.oncontextmenu=new Function("event.returnValue=false;"); document.onselectstart=new Function("event.returnValue=false;"); </SCRIPT>
注意不要复制入空格
2.不许复制网页,将下面代码加到网页代码的最后(</html>后面):
<!-- 禁止复制的代码开始 -->
<noscript>
<iframe scr="*.htm"></iframe>
</noscript>
<script language="JavaScript">
document.oncontextmenu=new Function("event.returnValue=false;");
document.onselectstart=new Function("event.returnValue=false;");
</script>
<!-- 禁止复制的代码结束 -->
禁止浏览器对网页进行缓存
<meta http-equiv=Pragma content=no-cache>
<meta http-equiv=expires content=0>
<meta http-equiv="cache-control" content="no-store">
禁止抓图
<script language="javascript">
<!--
function testclip(){
try {
if(clipboardData.getData("Text")||clipboardData.getData("HTML")||clipboardData.getData("URL"))
{
null;
}
}
catch(e){
clipboardData.setData("Text","")
}
setTimeout("testclip()",500)
}
testclip();
//-->
</script>
</head>
禁止另存为
<noscript><iframe src=*.html></iframe></noscript>
屏蔽左右键
<body oncontextmenu="return false" onselectstart="return false">