织梦复制网站文章内容自动加版权代码教程
作者:king发布时间:2023-05-10分类:CMS教程浏览:490
导读:当复制文章内容时,自动加版权与文章详细页网址的实现方法:将下面的js代码插入到文章内容页模板的<head>与</head>标签中间就行...
当复制文章内容时,自动加版权与文章详细页网址的实现方法:
将下面的js代码插入到文章内容页模板的<head>与</head>标签中间就行
01 |
<script language="javascript" type="text/javascript"> |
03 |
document.body.oncopy = function () { |
04 |
setTimeout( function () { |
05 |
var text = clipboardData.getData("text"); |
07 |
texttext = text + "\r\n文章来自:www.80zhan.com织梦模板详文参考:"+location.href; |
08 |
clipboardData.setData("text", text); |
|