复制内容添加版权信息

var thehits=document.getElementById("thehit");
if (thehits!=null){
thehits.innerHTML="22936";
}

document.body.oncopy = function ()
{
setTimeout(
function ()
{
var text = clipboardData.getData("text");
if (text)
{
text = text + "\r\n本文转自【网站名称】:"+location.href;
clipboardData.setData("text", text);
}
},
100
)
}
window.onload = function()
{
this.focus();
}
posted @ 2012-05-29 14:28  SOD_QWER  阅读(121)  评论(0编辑  收藏  举报