Sometimes, if we don’t want the content presented on our web pages to be stolen with ulterior motives, we need to add a copy prohibition function to the web page. After prohibiting copying, general browsers can also copy it into plain text. This problem cannot be completely eliminated. At this time, we need to completely prohibit right-clicking and copying on the page.
It is actually very simple to implement. You only need to add the following tags to the web page (note that it is immediately after the body):
<body 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()>
This is only the most preliminary method, and it is also easy to be cracked. If you are afraid that the web page will be saved as a local file by others, you can add the following code to prevent others from saving it:
<noscript> <iframe src=*.htm></iframe> </noscript>
Finally, some webmasters may only need a function to prohibit copying, and do not need to prohibit right-clicking. Then 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 ()>
The above is the entire content of this article. I hope it will be helpful to everyone's study. I also hope that everyone will support Script Home.