How JavaScript Masks replication capabilities

Source: Internet
Author: User

How JavaScript Masks Replication features:
Some webmasters do not want content to be easily copied by others, so the code is forbidden to copy the content of the Web page, of course, this may be a little knowledge of the Web site of the role of people, but also can play a certain role, at least the customer is a demand, so programmers must be.
Replication generally uses right-click Assignment, and one way to do this is to use the CTRL + V key to copy, and here's a piece of code that blocks both.
The code example is as follows:

document.oncontextmenu=function() {   returnfalse;} document.onkeydown =function() {   if(event.ctrlkey&&window.event.keycode==67) {      return false ;   } } document.body.oncopy=function() {   returnfalse;} Document.onselectstart=function() {}

The above code masks the right-click Copy paste and Ctrl + V copy sticky paste functionality.

The original address is: http://www.softwhy.com/forum.php?mod=viewthread&tid=8291

For more information, refer to: http://www.softwhy.com/javascript/

How JavaScript Masks replication capabilities

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.