1. Home
  2. Computing & Technology
  3. JavaScript

Image Protection

Join the Discussion

Questions? Comments?

More of this Feature

How to Use this Form

Using a no right click script wont stop anyone stealing the images from your page. If anything it will just encourage people to take your images since use of such a script shows that you consider the images to be worth stealing.

Instead why not let the would be thieves right click on your image and select save but instead of saving your image have them save a different one instead. How can you do this? Well we can place the image to be displayed into a table as the background for the table and then place a transparent image in front of it as the table content. Anyone saving the image will be saving the transparent image and not the background one. Hopefully they wont notice that they have saved the wrong image until much later and will decide that returning to your site to steal the right one is too much effort.

To make things really easy for you the form below will create the entire table for you. All you need to do is to enter the details of your image into the form and select the create image button.

Image:
Image Width:
Image Height:
Alternate Text:

All that you need to do is to copy the generated code into your page in place of the image link that you would normally use to place the image into your page.

The only other thing you'll need is the transparent image that is to be placed into the table in front of your image. You can get that by right clicking on and saving the image below (no you wont be saving the photo of me, you'll be saving the transparent gif file in front of it).

Right click and save image to use with the generated table

Note that there is no way to protect anything in web pages from being stolen. Applying this "protection" only stops your image being saved from the context menu and does not prevent it being taken in other ways. It does however give a clear indication that you don't want people to take your image without interfering with the functioning of their web browser.

Explore JavaScript
About.com Special Features

Stay connected and entertained with reviews on tips on the latest HDTVs, cellphones and more. More >

Easy ways to connect two computers for networking purposes. More >

  1. Home
  2. Computing & Technology
  3. JavaScript

©2009 About.com, a part of The New York Times Company.

All rights reserved.