Disabling Right Clicks on your Website


Some web masters simply hate it when other people copy their text and images for use on their own websites or for any other unacceptable purposes. If you want to minimize the copying of your web content by your visitors, you can simply disable the right click function of the mouse whenever they’re at your site.

However, doing so may have negative implications on your visitors as well. They might think that you’re accusing them as thieves. And you’re actually disabling other useful browser tools such as opening a website on a new page.

But if you still would like to disable the right-clicking functions of the mouse on your website, the html javascript that appears below can help.

Please note that it would work only on a server that has java script enabled. Make sure that your host supports it. Also, you have to put the entire script unchanged, inside the <body> </body> tags of your main html file. Always make a back-up of your index.html file before making any changes to it.

<SCRIPT language=”JavaScript”>
<!–
var message=”Dooh!! The right-click has been disabled on this page!”;
function click(e) {
if (document.all) {
if (event.button==2||event.button==3) {
alert(message);
return false;
}
}
if (document.layers) {
if (e.which == 3) {
alert(message);
return false;
}
}
}
if (document.layers) {
document.captureEvents(Event.MOUSEDOWN);
}
document.onmousedown=click;
// –>

AndysWebTools...Easy as Pie! AndysWebTools...Easy as Pie!