How does js automatically add copyright information to a webpage copy?

Source: Internet
Author: User
Tip: you can modify some code before running

<html><body>Is it sad that the articles I 've worked so hard to write are easily copied and pasted by others? Now, let's teach you how to automatically add your copyright information at the end of the article when someone else replicates his/her article. Please try to copy this article and paste it into your notepad to see if the text "This article is reproduced from Yunlong network" is automatically displayed at the end of the article. The method is as follows: add at the end of the webpage:<script type="text/javascript">Document. body. oncopy = function () {setTimeout (function () {var text = clipboardData. getData ("text"); if (text) {text = text + "rn this article is from: webpage special effect Network (www.111cn.net) detailed source reference:" + location. href; clipboardData. setData ("text", text) ;}, 100 )}</script></body></html>This code is provided by the webpage special effect network.
Tip: you can modify some code before running

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.