Calendar

2008年一月
« 十二   二 »
 123456
78910111213
14151617181920
21222324252627
28293031  

Translator

一些简单JP代码防止内容抄袭

利于简单JP代码就可以降低您的网站被内容抄袭,虽然可以破解但是还是您的站点的版权保护。

复制网站内容的时候自动加入版权信息

?View Code JAVASCRIPT
1
2
3
4
5
6
7
8
9
10
<script type="text/javascript">
document.body.oncopy = function () {
setTimeout( function () {
  var text = clipboardData.getData("text");
  if (text) {
   text = text + "\r\n本文来自:EricBess.com 详细出处参考:"+location.href; clipboardData.setData("text", text);
  }
    }, 100 )
}
</script>

以wordpress为例在head.php <body>后加上

?View Code JAVASCRIPT
1
2
3
4
5
6
7
8
<script type="text/javascript">
	document.body.oncopy=function(){
		event.returnValue=false;
		var t=document.selection.createRange().text;
		var s="本文来源于< ?php bloginfo('name'); ?>, 原文地址: < ?php the_permalink(); ?> ";
		clipboardData.setData('Text','\r\n'+t+'\r\n'+s+'\r\n');
	}
</script>

Click to continue reading