Copy Code code as follows:
<body oncontextmenu= ' return false ' onselectstart= ' return false ' ondragstart= ' return false ' onbeforecopy= ' return False "Onmouseup=document.selection.empty () Oncopy=document.selection.empty () Onselect=document.selection.empty () ></body>
Say the red above the insert into the Web page you can achieve the right mouse click is not valid
Onselectstart= "return false" prohibits selection, ondragstart= "return false" to prohibit drag and drop, Oncopy=document.selection.empty () prohibit copy.
Forbidden to Save: <noscript><iframe src= "*.htm" ></IFRAME></NOSCRIPT>
Prohibit pasting: <input type=text onpaste= "return false" >
Close IME: <input style= "ime-mode:disabled" >
Mask right mouse button:
function Document.oncontextmenu () {event.returnvalue=false;}
Shielding F1 Help:
function Window.onhelp () {return false}
Shielding other keys
Copy Code code as follows:
function Document.onkeydown ()
{
if ((Window.event.altKey) &&
((window.event.keycode==37) | |//Shielding ALT + Direction key ←
(window.event.keycode==39))) Shielding Alt + Direction key →
{
Alert ("You are not allowed to use ALT + arrow keys forward or back page!") ");
Event.returnvalue=false;
}
* Note: This is not really shielding ALT + arrow keys,
Because ALT + ARROW keys pop-up warning box, hold down the ALT key,
With the mouse point off the warning box, this shielding method is invalid. Later if
There is a master who has really shielded the Alt key method, please inform. */
if ((event.keycode==8) | |//SHIELDING BACKSPACE Delete key
(event.keycode==116) | | Mask F5 Refresh Key
(Event.ctrlkey && event.keycode==82)) {//ctrl + R
event.keycode=0;
Event.returnvalue=false;
}
if (event.keycode==122) {event.keycode=0;event.returnvalue=false;}//Mask F11
if (Event.ctrlkey && event.keycode==78) Event.returnvalue=false; Block CTRL + N
if (Event.shiftkey && event.keycode==121) Event.returnvalue=false; Shielding SHIFT+F10
if (Window.event.srcElement.tagName = "A" && Window.event.shiftKey)
Window.event.returnValue = false; Screen shift plus left mouse button new page open
if ((Window.event.altKey) && (window.event.keycode==115))//Shielding ALT+F4
{
Window.showmodelessdialog ("About:blank", "" "," dialogwidth:1px;dialogheight:1px ");
return false;
}
}
Screen printing:
Copy Code code as follows:
<style>
@media print{
* {Display:none}
}
</style>