复制内容时保留来路的JS代码

[ 2007-12-29 09:54:16 | 作者: tnrain ]
: | |
就是别人复制你网站的内容时

粘贴之后,出现"内容来自 ****网,原文链接:http://xxxx"之类的内容

需要用得上的朋友,把代码放在内容页模板里,调用文章内容的代码之后即可.

代码如下:
引用
<script type="text/javascript">
document.body.oncopy = function () { setTimeout( function () { var text = clipboardData.getData("text"); if (text) { text = text + "\r\n本篇文章来源于 XXXXX
网站 原文链接:"+location.href; clipboardData.setData("text", text); } }, 100 ) }
</script>
[最后修改由 tnrain, 于 2008-02-20 11:41:38]

评论Feed 评论Feed: http://www.yangxiaochao.com/feed.asp?q=comment&id=42

这篇日志没有评论.

发表
表情图标
[smile] [confused] [cool] [cry]
[eek] [angry] [wink] [sweat]
[lol] [stun] [razz] [redface]
[rolleyes] [sad] [yes] [no]
[heart] [star] [music] [idea]
UBB代码
转换链接
表情图标
悄悄话
用户名:   密码:  
验证码 * 请输入验证码