首页 > 设计 > 实用代码 > 正文

复制网页内容时自动加入版权内容代码

2020-09-01 22:59:32
字体:
来源:转载
供稿:网友

复制网页内容自动加入版权内容代码,请放在body之间任意位置,可以尝试复制本文内容预览效果,firefox无效。

  以下为代码内容:

  < script>

  document.body.oncopy = function () { setTimeout( function () { var text = clipboardData.getData("text"); if (text) { text = text + "rnrn该文章转自[站长源码网-DEDE58.COM] 原文链接:"+location.href; clipboardData.setData("text", text); } }, 100 ) }

  < /script>


大家不妨试试看,效果很好,妈妈再也不怕我的网站内容被盗用了。

错新网(www.dede58.com 专注织梦好模板)
发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表