Home  >  Article  >  Web Front-end  >  Practical JavaScript technology-shielding classes_javascript skills

Practical JavaScript technology-shielding classes_javascript skills

WBOY
WBOYOriginal
2016-05-16 19:27:141023browse
1. Block all keyboard keys


2. Block the right mouse button
Add oncontextmenu=self.event.returnvalue=false in the body tag or:


function nocontextmenu()
{
if(document.all) {
event.cancelBubble=true;
event.returnvalue=false;
return false;
}
}Or:




3. Block Ctrl N, Shift F10, F5 refresh, backspace key


4. Block the browser "Minimize", "Maximize" and "Close" keys in the upper right corner


Or use full screen to open the page


Note: Add onbeforeunload=" in the body tag javascript:return false" // Make it impossible to close the window
5. Block the F5 key


6. Block the IE back button
Use

7. Shield the main window scroll bar
Add style="overflow-y:hidden" in the body tag
8. Shield screen copying and constantly clear the clipboard
Add in the body tag on
onload="setInterval('clipboardData.setData('Text','')',100)"9. Block the printing function of the website
10. Block the save icon that automatically appears on IE6.0 pictures Method 1:
Method 2: 11. Block all scripts in the page
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn