Home U.S. Coin Forum

Russ - please post this agin

Russ,

Would you please post that bit of code that protects against right clicking and copying graphics?

Thanks in advance image

Comments

  • nwcsnwcs Posts: 13,386 ✭✭✭
    Put this into the body section of html:

    <script language=JavaScript>
    <!--

    var message="Function Disabled!";

    ///////////////////////////////////
    function clickIE4(){
    if (event.button==2){
    alert(message);
    return false;
    }
    }

    function clickNS4(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=clickNS4;
    }
    else if (document.all&&!document.getElementById){
    document.onmousedown=clickIE4;
    }

    document.oncontextmenu=new Function("alert(message);return false")

    // -->
    </script>

    Note, that anyone can disable script processing for their page and still use the right click method.
  • airplanenutairplanenut Posts: 22,149 ✭✭✭✭✭


    << <i>Note, that anyone can disable script processing for their page and still use the right click method. >>

    There are also a lot of ways around the script...

    Why do you want it?
    JK Coin Photography - eBay Consignments | High Quality Photos | LOW Prices | 20% of Consignment Proceeds Go to Pancreatic Cancer Research
  • GPGP Posts: 186
    you can also just view source and copy the img src url from the code to get around it. I find those type of scripts very annoying, especially since I surf with many many windows and open almost anything into a new window.

    If you want to protect a picture, just put a watermark with your name across it, so anyone using it will be giving credit to you. Just make sure you put the watermark where it can not be easily photoshopped out.
    image
  • LokiLoki Posts: 897 ✭✭


    << <i>There are also a lot of ways around the script... >>

    It is a good deterrent as most people do not know how to get around it. I didn't either without resorting to searching my temp folder, and I am a software engineer lol. That is, until Russ posted an ez mouse click solution.image

Leave a Comment

BoldItalicStrikethroughOrdered listUnordered list
Emoji
Image
Align leftAlign centerAlign rightToggle HTML viewToggle full pageToggle lights
Drop image/file