Prevent Image Copying - Prevent Right Click
   
Home: Graphic Academy
 
Graphics Books
 
Graphics File Formats
  Animation File Formats
Bitmap File Formats
CAD File Formats
Cursor File Formats
Font File Formats
Icon File Formats
Metafile File Formats
Prepress File Formats
Vector File Formats
Video File Formats
Web File Formats
More Graphics File Formats
 
Graphics Software
  Banner Design Software
CAD Software
Diagram Drawing Software
Illustration Software
Photo Editing Software
Video Conversion Software
More Graphics Software
 
Graphics Tutorials
 
  • Adobe Dreamweaver Tutorials
  • Adobe Photoshop Tutorials
  • AutoCAD Tutorials
  • How To Draw Tutorials
    Banner Design Tutorial
    Banner Display Tutorial
    Color Combinations Tutorial
    Color-Safe Conversion Tutorial
    eBook Covers Tutorial
    Favicon Tutorial
    GIF + Photo Tutorial
    Good Web Design
    Image Slice Tutorial
    Image Tiling Tutorial
    Imagemap Tutorial
    Photography Tutorial
    Prevent Copying Tutorial
    Screenshots Tutorial
    Should I Use Flash?
    Text to Images Tutorial
    Web Image File Formats
    More Graphics Tutorials
  •  
    Graphics Glossary

    Advertisement
     
    Learn PhotoShop


    Perfect for Beginners...
    - Start immediately
    - Save time
    - Avoid confusion
    - Save effort
    - Improve creativity
    - From beginner to advanced
    Click here
     
         
    GraphicsAcademy.com  >  Tutorials  >  Prevent Image Copying  >  Chapter 1

       

     

    How To Prevent Image Copying

    Chapter 1: Prevent Right Click

    Probably the most common way to prevent copying is to use a little JavaScript to prevent users right clicking on an image and doing Save As...
    (If you're not familiar with JavaScript or just want to learn more, then get yourself a good JavaScript Tutorial).

    Below is an example of such code (insert it in the <HEAD> section of your HTML pages). Unlike most code of this type (most people seem to get it wrong), this should code work with both with Netscape and Internet Explorer.

    <SCRIPT LANGUAGE="JavaScript"><!--
    var message = 'Please respect our Copyright.' ;
    function clickie() {
    if (document.all) {
    alert(message);
    return false; } }
    function clickns(e) {
    if (document.layers||(document.getElementById&&!document.all)) {
    if (e.which==2 || e.which==3) {
    alert(message);
    return false; } } }
    if (document.layers) {
    document.captureEvents(Event.MOUSEDOWN);
    document.onmousedown=clickns;
    } else {
    document.onmouseup=clickns;
    document.oncontextmenu=clickie;
    }
    // --></SCRIPT>


    This idea works reasonably well but it's not totally secure: users can get around it by (for example) disabling JavaScript.

    Another issue with this script is that it can be kind of annoying:
    • The script displays a message if the user does try to right-click. Some webmasters might prefer to simply silently prevent right-clicks.

    • Users are forbidden to right-click anywhere on the web page. This stops "legitimate" right clicks (for example to open an image in a new browser window).

    Discuss Prevent Image Copying - Prevent Right Click


       

    Please feel free to post your comments:




      
    How To Prevent Image Copying:
     
     
      << PreviousIntroduction   1   2   3   4   5Next >>  
       


       
     
       
     
       
    Disclosure: Our company's websites' content (including this website's content) includes advertisements for our own company's websites, products, and services, and for other organization's websites, products, and services. In the case of links to other organization's websites, our company may receive a payment, (1) if you purchase products or services, or (2) if you sign-up for third party offers, after following links from this website. Unless specifically otherwise stated, information about other organization's products and services, is based on information provided by that organization, the product/service vendor, and/or publicly available information - and should not be taken to mean that we have used the product/service in question. Additionally, our company's websites contain some adverts which we are paid to display, but whose content is not selected by us, such as Google AdSense ads. For more detailed information, please see Advertising/Endorsements Disclosures

    Our sites use cookies, some of which may already be set on your computer. Use of our site constitutes consent for this. For details, please see Privacy.

    Contact Us     Privacy     Terms Of Use     Advertising/Endorsements Disclosures

    Copyright © 2005-2014, Answers 2000 Limited

    In Association With Amazon.com
    Answers 2000 Limited is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to Amazon.com.
    In Association With Amazon.co.uk
    Answers 2000 Limited is a participant in the Amazon EU Associates Programme, an affiliate advertising programme designed to provide a means for sites to earn advertising fees by advertising and linking to Amazon.co.uk.

    CERTAIN CONTENT THAT APPEARS ON THIS SITE COMES FROM AMAZON SERVICES LLC. THIS CONTENT IS PROVIDED 'AS IS' AND IS SUBJECT TO CHANGE OR REMOVAL AT ANY TIME.
    CERTAIN CONTENT THAT APPEARS ON THIS SITE,COMES FROM AMAZON EU S. r.l. THIS CONTENT IS PROVIDED 'AS IS' AND IS SUBJECT TO CHANGE OR REMOVAL AT ANY TIME.

    All trademarks are property of their respective owners.
    All third party content and adverts are copyright of their respective owners.

    Some graphics on our web sites are Copyright (C) 1997-2000 Hemera Technologies Inc., and used under license. All such pictures are provided for viewing purposes only and are not to be saved or downloaded. All such pictures of recognizable individuals are models and used for illustrative purposes only, and not meant to imply any association or endorsement of said individual with any product or service.
     
       
    Photo Editor X Photo Editing Software