复制页面内容后自动在后面加上网站信息,有利于SEO

可以将代码放在网页任意地方

<script type="text/javascript">
document.body.oncopy = function () {
 setTimeout( function () {
  var text = clipboardData.getData("text");
  if (text) {
   text = text + "\r\n本篇文章来源于Lancui's BLOG:"+location.href; clipboardData.setData("text", text);
  }
 }, 100 )
}
</script>