Results 1 to 2 of 2

Thread: Disable right click script

  1. #1
    Join Date
    Apr 2008
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question Disable right click script

    1) Script Title: Disable right mouse click script

    2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex9/noright.htm

    3) Describe problem: I have looked at all the threads and may have over looked the answer to what I need to know. If so I'm sorry.
    I am trying to use your script code on y web page:
    <script language=JavaScript>
    <!--

    //Disable right mouse click Script
    //By Maximus (maximus@nsimail.com) w/ mods by DynamicDrive
    //For full source code, visit http://www.dynamicdrive.com

    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>

    I have designed my web page with Word 2000. Your web site says to copy the code and past it to the <BODY>. I am new to web design. Does the <BODY> mean the main index page? If so do I aste the code at the botton of the index page perhaps below the web counter code? Do I need to put this code on each web page in my master web files, or just the main index page?

    I really hope this code works, I have had to take off all my custom engraved designs because some have been taken from my web site already.

    Thank You

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    No the body is a section of the source code of the page. This is best done in a text only editor like NotePad. But the script is worthless, I guarantee it. So, if you want to start learning about javascript, choose another script, but stick to something simple.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •