Javascript disable right click and image tool bar

A recent request from a client was to make life more difficult for his competitors to steal images from his site. He was worried that they could save the images using the Image Toolbar in newer versions of Internet Explorer, and by using the right click menu on the page. For those of you that wish to stop the right clickers from stealing your code, or from stealing images, here is a quick and easy way to make life more difficult for them.

To disable the Internet Explorer Image Toolbar for an entire page add this meta tag:

<meta http-equiv="imagetoolbar" content="no">

To disable the Internet Explorer Image Toolbar for an individual Image do this:

<img src="image.gif" width="250" height="250" galleryimg="no>

Now to handle those who love their “right-click”. For the entire page:

<body oncontextmenu="return false">

And for individual images:

<img src="image.gif" width="250" height="250" oncontextmenu="return false">

Published by

Adam

Application Architect from Florida

Leave a Reply

Your email address will not be published. Required fields are marked *