Membership is FREE, giving all registered users unlimited access to every Acorn Domains feature, resource, and tool! Optional membership upgrades unlock exclusive benefits like profile signatures with links, banner placements, appearances in the weekly newsletter, and much more - customized to your membership level!

disable right click

Status
Not open for further replies.

Admin

Administrator
Staff member
Joined
Jun 14, 2004
Posts
11,076
Reaction score
962
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.

The Rule #1

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

Members online

Premium Members

New Threads

Domain Forum Friends

Our Mods' Businesses

*the exceptional businesses of our esteemed moderators
General chit-chat
Help Users
  • No one is chatting at the moment.
      There are no messages in the current room.
      Top Bottom