Method One:
Disables the right-click menu, copy, select
$ (document). Bind ("ContextMenu copy Selectstart", function () {return
false;
});
Method Two:
Disable CTRL + C and CTRL + V (supported by all browsers)
$ (document). KeyDown (function (e) {
if E.ctrlkey && (e.keycode = 65 | | E.keycode = =) ({return
false;
}}
);
Method Three:
Set CSS to prohibit selection (if you write the following CSS you do not need this piece of code, 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"
});
Method Four: Prevent disabling JavaScript after invalidation, can be written in CSS (new browser support, and gradually become the standard):
Body {
-moz-user-select:none/* Firefox private property */
-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 * * * *
Opera Private
Properties * * User-select:none; /* CSS3 Properties */
}