Sometimes, we don't want the content presented in our web page to be stolen by someone with ulterior motives, so we need to add a function to prohibit copying on the web page. However, general browsers can still use copy as plain text after prohibiting copying, which cannot completely eliminate this problem. 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 just a preliminary method and can be easily cracked. If you are afraid that the webpage 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. In this case, add the following code in <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 full content of this article. I hope it will be helpful for everyone’s study. I also hope that everyone will support 123WORDPRESS.COM. |
<<: Use of MySQL stress testing tool Mysqlslap
>>: Docker configuration Alibaba Cloud image acceleration pull implementation
Table of contents cache Cache location classifica...
Docker-compose deployment configuration jenkins 1...
1. Introduction In the past, if you wanted to emp...
There is a medicine for regret in the world, as l...
Display different menu pages according to the use...
This article shares the specific code of jQuery t...
Use stored procedures to start transactions when ...
Table of contents MySQL case sensitivity is contr...
Recently, due to work needs, I need to format num...
Table of contents 1. What is a calculated propert...
<br />This is a series of tutorials provided...
This article uses an example to describe how MySQ...
Table of contents Basic Introduction Getting Star...
Table of contents Step 1: Update Packages on Cent...
drop procedure sp_name// Before this, I have told...