Web Analytics Made Easy -
StatCounter "HELP...NoRightClick script has a problem???" - CodingForum

Announcement

Collapse
No announcement yet.

"HELP...NoRightClick script has a problem???"

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • "HELP...NoRightClick script has a problem???"

    I recently used this script (No Right Click) from DD.

    I 've got a problem which I cannot sort it out.

    I copy and paste the script and everything looks fine....
    BUT, when I preview my site and press the right click I get the message "function disabled" (that's fine), when I press OK to that the right click menu appears!!!!
    WHY is that???
    I would appreciate any comments on that.

    Thanks

    Here's the script I 'm using:
    _________
    <script language=JavaScript>
    <!--

    //Disable right mouse click Script
    //By Maximus ([email protected]) 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>

  • #2
    sorry, the script works fine on my machine!(?)...why don't you try the silent 'right disable script' instead?

    <script language=JavaScript>
    <!--

    //Disable right click script III- By Renigade ([email protected])
    //For full source code, visit http://www.dynamicdrive.com

    var message="";
    ///////////////////////////////////
    function clickIE() {if (document.all) {(message);return false;}}
    function clickNS(e) {if
    (document.layers||(document.getElementById&&!document.all)) {
    if (e.which==2||e.which==3) {(message);return false;}}}
    if (document.layers)
    {document.captureEvents(Event.MOUSEDOWN);document.onmousedown=clickNS;}
    else{document.onmouseup=clickNS;document.oncontextmenu=clickIE;}

    document.oncontextmenu=new Function("return false")
    // -->
    </script>
    Jase/djmothra

    Comment


    • #3
      Thanks.......
      I am going to use a different script.......that works.
      thanks for the suggestion.

      It is unexplained.......anyway......
      Cheers

      Comment

      Working...
      X