Disable Images Right Click
December 20, 1999
Disable Images Right Click, freely available at
The JavaScript Source
works in 4.0+ browsers. It's main purpose in life is to
prevent visitors to your site from right clicking on an image.
This in turn prevents them from saving the image to their
hard drive.
The script requires no modification at all. Simply
copy it and paste it between the <HEAD> </HEAD>
elements in your HTML document and add an onload function
to the <BODY> element!
<SCRIPT LANGUAGE="JavaScript">
<!-- This script and many more are available free online at -->
<!-- The JavaScript Source! http://javascript.internet.com -->
<!-- Begin
function right(e) {
var msg = "Sorry, you don't have permission to right-click.";
if (navigator.appName == 'Netscape' && e.which == 3) {
alert(msg);
return false;
}
if (navigator.appName ==
'Microsoft Internet Explorer' && event.button==2) {
alert(msg);
return false;
}
else return true;
}
function trap() {
if(document.images)
for(i=0;i<document.images.length;i++)
document.images[i].onmousedown = right;
}
// End -->
</SCRIPT>
Don't forget to add an onload function
to your <BODY> tag and you'll be ready to roll!
<BODY onLoad="trap()">
This script works great in conjunction with the following
CGI Script.
Protecting Images and Bandwidth
FHimageprotect V1.2
|