Web Developer's Virtual Library: Encyclopedia of Web Design Tutorials, Articles and Discussions


WDVL Newsletter

Active Server Pages
JSP/Java Servlets
Microsoft SQL Server
Daily Backup
Dedicated Servers
Streaming Audio/Video
24-hour Support    

jobs.webdeveloper.com

Hiermenus


e-commerce
Partner With Us















Developer Channel
FlashKit.com
JavaScript.com
JavaScriptSource
Developer Jobs
ScriptSearch
StreamingMediaWorld
Web Developer's Journal
Web Developer's Virtual Library
WebDeveloper.com
Webreference
Web Hosts
XMLfiles.com

internet.com
IT
Developer
Internet News
Small Business
Personal Technology

Search internet.com
Advertise
Corporate Info
Newsletters
Tech Jobs
E-mail Offers


Disable Images Right Click

December 20, 1999

Disable Images Right Click

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


Up to => Home / Authoring / Graphics / Theft




Jupiter Online Media: internet.comearthweb.comDevx.commediabistro.comGraphics.com

Search:

Jupitermedia Corporation has two divisions: Jupiterimages and Jupiter Online Media

Jupitermedia Corporate Info


Legal Notices, Licensing, & Permissions, Privacy Policy.

Web Hosting | Newsletters | Tech Jobs | Shopping | E-mail Offers