分类: 学习资源
作者:

访客复制博客文章自动加上 版权信息。
对于版权保护基本都是靠自觉,防复制是没用的。
尤其是 出现 Hprsnap 这样可以抓文字的软件以后。
干扰码也有 屏蔽它的转帖器了。

把以下代码加到 模板的 底部 适当位置 

JavaScript代码
  1. <script type="text/javascript">       
  2. document.body.oncopy = function () {        
  3.         setTimeout( function () {        
  4.                 var text = clipboardData.getData("text");       
  5.                 if (text) {        
  6.                         text = text + "本文来自: 飘飞的落叶's blog "+location.href; clipboardData.setData("text", text);       
  7.                 }        
  8.                                 }, 100 )        
  9. }       
  10. </script>     

 

以前 pjblog 有一个文章水印插件跟这个差不多,代码如下

JavaScript代码
  1. <script defer>       
  2.         document.body.oncopy=new Function("setTimeout(addData,300);");       
  3.         document.oncopy=new Function("setTimeout(addData,300);");       
  4.         function addData()       
  5.         {       
  6.           var d = window.clipboardData.getData('Text');       
  7.           window.clipboardData.setData('Text',d+"原文网址:"+document.location.href);       
  8.         }       
  9.         </script>     
标签: 资料, 网络