来源: 互联网 日期: 2020-07-16 13:58:28
当复制文章内容时,自动加版权与文章详细页网址的实现方法:
将下面的js代码插入到文章内容页模板的<head>与</head>标签中间就可以了:
<script language="javascript" type="text/javascript">
<!--
document.body.oncopy = function () {
setTimeout( function () {
var text = clipboardData.getData("text");
if (text) {
text = text + "\r\n文章来自:资源库详文参考:"+location.href;
clipboardData.setData("text", text);
}
}, 100 )
}
-->
</script> (抓润网帝国模板 www.zhuarun.com)