JAVAscript code that automatically attaches copyright information when copying an article

Source: Internet
Author: User

Many of my friends asked some questions in Q group. The small editor on this site is an enthusiastic person, because only when others are happy can they be happy. This is the motto of all the staff of the fire station College. in the previous documents of the institute of fire station, whenever you copy any paragraph or word in the article on this site, the end of the article always appears "This article comes from the Institute of fire station (www.bkjia.com) for details about the source, see:/http://www.bkjia.com/a/view/44443.html#sentence. This protects the copyright of website articles. Another benefit is that when others collect the content of your website, these copyright information will also be collected, which will greatly increase your external links. To increase yourPrvalue.

Today, another netizen asked this question, so the editor of the institute of fire station decided to write it out and share it with you. In fact, it is not difficult to achieve this effect, you only need to insert the following code into any part of the webpage BODY and BODY.

The content of the Code is as follows:

Copy to ClipboardReference: [www.bkjia.com] <script type = "text/javascript">
Document. body. oncopy = function () {setTimeout (function () {var text = clipboardData. getData ("text"); if (text) {text = text + "/this article is from the original source of www.bkjia.com:" + location. href; clipboardData. setData ("text", text) ;}, 100 )}
</Script>

 

When you are using it, you only need to change the "this article from www.bkjia.com" in the code to your website information. Do not forget it, otherwise, it will bring traffic and external links to the school.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.