HTML page content prohibit selection, copy, right-click
Just in a look at a site source of the time to find, in fact, it is really simple
<body leftmargin=0 topmargin=0 oncontextmenu= ' return false ' ondragstart= ' return false ' Onselectstart = ' return False ' Onselect= ' Document.selection.empty () ' oncopy= ' document.selection.empty () ' onbeforecopy= ' return false ' onmouseup= ' Document.selection.empty () ' >
The key is
Oncontextmenu= ' return false ' ondragstart= ' return false ' Onselectstart = ' return false ' onselect= ' Document.selection.empty () ' oncopy= ' document.selection.empty () ' onbeforecopy= ' return false ' onmouseup= ' Document.selection.empty () '
An easier way is to add the following code to the <body> so that the left and right mouse buttons are invalidated.
topmargin= "0" oncontextmenu= "return false" ondragstart= "return false" Onselectstart = "return false" onselect= " Document.selection.empty () "oncopy=" Document.selection.empty () "onbeforecopy=" return false "onmouseup=" Document.selection.empty () "
1. Prevent web pages from being saved as: Add the following code after <body>:
<noscript> <iframe src= "*.htm" ></iframe> </noscript>
2. Prevents Web page content from being copied. Paste: Add the following code to <body>:
<body Onmousemove=/hidemenu ()/oncontextmenu= "return false" ondragstart= "return false" Onselectstart = "return false" "Onselect=" Document.selection.empty () "oncopy=" Document.selection.empty () "onbeforecopy=" return false "onmouseup=" Document.selection.empty () ">
HTML page prohibit selection, page ban copying, page suppression right-click