欢迎访问全国企业网站设计NO.1网站开发商平台 付款方式
主页 > 网站建设 > 建站知识 > 织梦复制网站文章内容自动加版权代码教程

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

POST TIME:2020-10-09

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

 

将下面的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.dede58.com详文参考:"+location.href;
            clipboardData.setData("text", text);
       } 
          }, 100 )
         }
         -->
        </script>