Code for adding the webpage source outlet address when others copy it

Source: Internet
Author: User

When original articles written by bloggers are published on their own blogs or websites, they are often reposted on other blogs or websites, there are always some people who do not add the original address and source when referencing others' articles, or even change the author to their own name or add their own URLs, causing unnecessary copyright disputes. For this reason, some authors have to add code that prohibits copying to their websites or blogs when publishing their articles, which is not conducive to reprinting and dissemination of articles. Qiu Qin also searched the internet for a long time before learning the following code. This can not only affect the reprinting and dissemination of articles, but also add his own copyright and carry his own website, in this way, we also allow those who are lazy to advertise our own website or blog for free.

Operation Method:

1. log on to the personal portal-go to my home-portal settings-homepage Module Settings-custom HTML.

2. Place the following code in the Custom HTML module. Replace the red text with your blog name and blog address and save the code.

In this way, when someone copies an article on our website, it will automatically include our own blog name and blog address.

<SCRIPT type = "text/JavaScript">
Document. Body. oncopy = function (){
SetTimeout (function (){
VaR text = clipboardData. getdata ("text ");
If (text ){
TEXT = text + "This article comes from" Daily secrets ": www.ttsmm.com original address:" + location. href;
ClipboardData. setdata ("text", text );
}
}, 100)
}
</SCRIPT>

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.