How to write the right-click code of a website
This article mainly explains "how to write the right-click code of a website". Interested friends may wish to take a look. The method introduced in this paper is simple, fast and practical. Next, let the editor take you to learn how to write the right-click code of a website.
Function disableRightClick (e) {var message = "what do children want to be discouraged! if you want to collect this site, please press CTRL+D! if you are trying to steal this site code, then don't bother, why do you right click on this window!" If (! document.rightClickDisabled) / / initialize {if (document.layers) {document.captureEvents (Event.MOUSEDOWN); _ document.onmousedown = disableRightClick;} else _ document.oncontextmenu = disableRightClick; return document.rightClickDisabled = true;} if (document.layers | | (document.getElementById &! document.all)) {if (e.which==2 | | e.which==3) {alert (message); return false;}} else {alert (message); return false }} disableRightClick (); at this point, I believe you have a deeper understanding of "how to write the right-click code of a website". You might as well do it in practice! Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!