Membership is FREE – with unlimited access to all features, tools, and discussions. Premium accounts get benefits like banner ads and newsletter exposure. ✅ Signature links are now free for all. 🚫 No AI-generated (LLM) posts allowed. Share your own thoughts and experience — accounts may be terminated for violations.

disable right click

Status
Not open for further replies.

AdminAdmin is verified member.

Administrator
Staff member
Joined
Jun 14, 2004
Posts
11,096
Reaction score
976
Disable Right Mouse Click if you want to stop someone easily stealing your website's valuable content:

No right click code:
Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>
<head>
<title>Your Title Here</title>
</head>
<body>
<SCRIPT LANGUAGE="JavaScript">
function noRightClick(buttonClicked) {
if (navigator.appName == 'Netscape' && 
(buttonClicked.which == 2 || buttonClicked.which == 3))
return false;
else if (navigator.appName == 'Microsoft Internet Explorer' && 
(event.button == 3 || event.button == 2)) {
alert("Sorry! This site is Copyright right click has been disabled");
return false;
}
return true;
}
document.onmousedown=noRightClick;
document.onmouseup=noRightClick;
if (document.layers)
window.captureEvents(Event.MOUSEDOWN);
if (document.layers) window.captureEvents(Event.MOUSEUP);
window.onmousedown=noRightClick;
window.onmouseup=noRightClick;
</script>test it here
</body>
</html>

Change the line:
Code:
alert("Sorry! This site is Copyright right click has been disabled");
to whatever message you want to display. "test it here" is where your site content would appear.

This can be easily bypassed by those in the know and Windows XP SP2 makes things more difficult as it gives the visitor the option to view the page without running this code but it is still better than nothing.
 
As mentioned, easily defeated. Mozilla Firefox ignores it for example
 
Disabling the right mouse button is a pointless exercise as by the time you can see the web page it has already been stored in cache on your computer therefore all images and content are easily obtainable. Of course one can also use the "Save As" option in Internet Explorer and most other browsers to the same effect.
 
.

admin is only trying to give a few helpfull tips here....

if anyone can post more hints/tips that could help the odd newbie out i am sure admin would appreciate, but please there is no point in dragging a thread down. Anything is usefull :)

Laskos
 
Status
Not open for further replies.

Rule #1: Be Respectful

Do not insult any other member. Be polite and do business. Thank you!

Premium Members

New Threads

Domain Forum Friends

Lastest Listings

Our Mods' Businesses

*the exceptional businesses of our esteemed moderators
General chit-chat
Help Users
  • No one is chatting at the moment.
  • Siusaidh AcornBot:
    Siusaidh has left the room.
      Siusaidh AcornBot: Siusaidh has left the room.
      Top Bottom