• Welcome to AcornDomains.co.uk, a friendly community for UK domain investors, developers and anyone interested in domain names.

    Whether you're looking to buy or sell domains, learn more about the UK domain market, get feedback on your names, or simply chat with other domainers, you're in the right place. AcornDomains has been bringing together people from across the UK domain industry for many years, from complete beginners to experienced investors.

    Have a look around, join the discussions and, if you haven't already, create a free account and introduce yourself.

disable right click

Status
Not open for further replies.

AdminAdmin is verified member.

Administrator
Acorn Staff
Acorn Moderator
Developer
Server Admin
Nominet Registrar
Joined
Jun 14, 2004
Posts
11,191
Reaction score
1,059
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.
Top Bottom