Get the App
SLTechnology News&Howtos  ›  Development  › 

How to write the right-click code of a website

Shulou Source: shulou.com Published: 2022-06-03 06:53:43 09月21日 Update

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!

Tags: Code website content learning practical deeper laborious interest child practical practical easy to operate method is in more friends channels query Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Tech Info vpn Huawei Redmi MariaDB