<body oncontextmenu= "return false" > Disable the right-click menu of the Web page, but you can still use shortcut keys to copy.
JS code disables the replication feature:
Copy Code code as follows:
<script type= "Text/javascript" >
Document.body.onselectstart=document.body.oncontextmenu=function () {return false;}
</script>
Note that this code must be placed behind the body element, in front or in the head without any effect.
Complement: Document.body.onselectstart page check function.
Document.body.oncontextmenu page Right menu.
Document.body.ondragstart page content drag and drop function, drag can be achieved replication. You need to disable replication when you prohibit it.
Document.body.oncopy page content copy function, when disabled, even if you clicked Copy or use shortcut keys but the contents of your clipboard are not what you have just copied but what you have previously placed in the Clipboard or empty.
Document.body.oncut page Content clipping features, disabling and effects are similar to disabling replication.
Note: When you use the above disabling function, if a corner of the page can also right-click or copy, it is because your body does not cover the entire page, you can add the following properties on the body.
Leftmargin=0 topmargin=0 style= "width:100%;height:100%;"
Disable the Copy function code by setting the Body property as follows:
Copy Code code as follows:
<body oncontextmenu= ' return false ' onselectstart= ' return false '
Ondragstart= ' return false ' oncopy= ' return false '
Oncut= "return false;
Leftmargin=0
Topmargin=0 style= "width:100%;height:100%;" >
The following code is to disable the Web page save as but I did not succeed in the test, who knows the reason can give a comment below, thank you.
<noscript>
<iframe scr= "*.htm" ></iframe>
</noscript>
</body>
JS Code case:
Copy Code code as follows:
Shielding right Button ***********************
function Click (e) {
if (document.all) {
if (event.button==1| | event.button==2| | event.button==3) {
Oncontextmenu= ' return false ';
}
}
if (document.layers) {
if (E.which = = 3) {
Oncontextmenu= ' return false ';
}
}
}
if (document.layers) {
Document.captureevents (Event.mousedown);
}
Document.onmousedown=click;
Document.oncontextmenu = new Function ("return false;")
//*******************************************
Document.onkeydown=function (evt) {
if (Document.selection.createRange (). parentelement (). Type = = "File" {
return false;
}
if ((event.keycode==116) | |//shielding F5 Refresh key
(Event.ctrlkey && event.keycode==82)) {//ctrl + R
event.keycode=0;
Event.returnvalue=false;
}
if ((Window.event.altKey) && (window.event.keycode==115)) {//Shield ALT+F4
return false;
}
}