js代码 复制网页内容时自动加版权信息

    <script language="javascript">
document.body.oncopy 
= function () { 
  setTimeout( 
function () { 
    
var text = clipboardData.getData("text");
    
if (text) { 
      text 
= text + " \r\n资料引用:"+location.href; clipboardData.setData("text", text);
    } 
        }, 
100 ) 
}
    
</script>

 

代码复制到<body></body>之间。

posted on 2008-09-26 15:14  truejob  阅读(542)  评论(0编辑  收藏  举报

导航