Prohibit copying Web page content

Source: Internet
Author: User

Take a note.

Disable the right-click menu, Copy, select $ (document). Bind ("ContextMenu copy Selectstart", function () {    return false;}); /Disable CTRL + C and CTRL + V (all browsers support) $ (document). KeyDown (function (e) {    if (e.ctrlkey && (e.keycode = = | | | e.keycode = = ()) {        return false;    }}); /Set CSS Disable selection (if you write the following CSS you do not need this piece of code, the new browser support) $ (function () {    $ ("body"). CSS ({        "-moz-user-select": "None",        "- Webkit-user-select ":" None ",        "-ms-user-select ":" None ",        "-khtml-user-select ":" None ",        "-o-user-select ":" None ",        " User-select ":" None "    });

Prevents JavaScript from disabling, can be written in CSS (new browser support, and gradually become the standard):

body {    -moz-user-select:none;  /* Firefox Private properties */    -webkit-user-select:none;  /* WebKit Kernel private properties */    -ms-user-select:none;  /* IE private properties (IE10 and later) */    -khtml-user-select:none;  /* khtml Kernel private properties */    -o-user-select:none;  /* Opera Private properties */    User-select:none;  /* CSS3 Property */}

Excerpted from http://www.code-life.com/?p=440

Prohibit copying Web page content

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.