织梦园模板网提供云优cms模板,pbootcms模板,Wordpress主题模板等各类企业新闻资讯网站模板下载服务。织梦园网站模板交流群
用户名:
密码:
注册
注册后享受折扣价

dede织梦复制网站文章内容自动加版权代码教程

织梦园模板 / 2019-04-18 / 收藏

当复制文章内容时,自动加版权与文章详细页网址的实现方法:

将下面的js代码插入到文章内容页模板的<head>与</head>标签中间就行

<script language="javascript" type="text/javascript">
    <!--
       document.body.oncopy = function () {
         setTimeout( function () {
          var text = clipboardData.getData("text");
          if (text) {
           texttext = text + "\r\n文章来自:www.dedeyuan.com<a href="http://www.dedeyuan.com/" target="_blank"><u>织梦模板</u></a>详文参考:"+location.href;
           clipboardData.setData("text", text);
      } 
         }, 100 )
        }
        -->
       </script>

相关安装使用

收缩