<!doctype html public "-//w3c//dtd xhtml 1.0 transitional//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd">
<html xmlns="http://www.111cn.net/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=gb2312" />
<title>复制内容自动加上文章链接地址的js代码</title><script type="text/网页特效">
document.body.oncopy = function () {
settimeout( function ()
{
var text = clipboarddata.getdata("text");
if (text) {
text = text + " 本篇文章来源于[左岸](http://www.111cn.net) 原文出处:"+location.href;
clipboarddata.setdata("text",text);
}
}, 100 )
}
</script>
</head>
<body>
fdsafsa
dagdsaf
s
af
sda
f
sa
<input type="button" name="submit" onclick='copytoclipboard()' value="复制本页文章地址,传给qq/msn上的好友" width="100" height="16">
<script language="javascript">
function copytoclipboard(){
var clipboardcontent="";
clipboardcontent+=document.title;
clipboardcontent+="";
clipboardcontent+=this.location.href;
window.clipboarddata.setdata("text",clipboardcontent);
alert("复制成功,请粘贴到您的qq/msn上推荐给您的好友");
} </script>
</body>
</html>