[JAVASCRIPT] Anti-right click

Page 1 of 2 12 LastLast
Results 1 to 15 of 26
  1. #1
    Account Upgraded | Title Enabled! Aiona is offline
    MemberRank
    Feb 2008 Join Date
    The NetherlandsLocation
    232Posts

    [JAVASCRIPT] Anti-right click

    hi all,

    well since everyone is posting little presents on ragezone, i'll
    do one to! it's not a big one tho, but usefull for some :)

    SS:


    Code:

    Code:
    <script language=JavaScript>
    <!--
    //Right click disable script By Mugodz007
    
    //Your message when pressed the right mouse button
    var message="Don't press the right click Moran!";
    
    ///////////////////////////////////
    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>
    Merry xmas (a bit to late xD) and a happy newyear!


    Ps: please thank me if you find this usefull
    Last edited by Aiona; 30-12-10 at 12:28 PM.


  2. #2
      Phoenix is offline
    ModeratorRank
    Mar 2009 Join Date
    6,890Posts

    Re: [PHP] Anti-right click

    A message box would be annoying.

    Code:
     <SCRIPT language="JavaScript">
    <!--
    //Disable right click script
    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>

  3. #3
    人◕ ‿‿ ◕人 Forean is offline
    MemberRank
    Jul 2008 Join Date
    1,183Posts

    Re: [PHP] Anti-right click

    I already know you didn't make this, One because its the same script with "Your name" on it that was released from another one, Also

    Should i add, I know this isn't yours because for the fact this is JAVA, not php.

    But yes, I guess this makes it easier for people to "not search google" and search Ragezone, but hey, Merry late Christmas.
    Last edited by Forean; 30-12-10 at 12:20 PM.

  4. #4
    Account Upgraded | Title Enabled! Aiona is offline
    MemberRank
    Feb 2008 Join Date
    The NetherlandsLocation
    232Posts

    Re: [PHP] Anti-right click

    Quote Originally Posted by ForeanXz View Post
    I already know you didn't make this, One because its the same script with "Your name" on it that was released from another one, Also

    Should i add, I know this isn't yours because for the fact this is JAVA, not php.

    But yes, I guess this makes it easier for people to "not search google" and search Ragezone, but hey, Merry late Christmas.
    we'll tbh with you, your right.
    but since this is used in php, i call it php.

  5. #5
    人◕ ‿‿ ◕人 Forean is offline
    MemberRank
    Jul 2008 Join Date
    1,183Posts

    Re: [PHP] Anti-right click

    Quote Originally Posted by mugodz007 View Post
    we'll tbh with you, your right.
    but since this is used in php, i call it php.

    But then you are wrong, It may be used in HTML also, This is Javascript


    You don't use this in the PHP tags either..


    Its not like <?php

    $somestuff

    <script>

    </script>

    ?>

    That would be an error

    So No, it is NOT Php, It is Java.

  6. #6
    Account Upgraded | Title Enabled! Aiona is offline
    MemberRank
    Feb 2008 Join Date
    The NetherlandsLocation
    232Posts

    Re: [PHP] Anti-right click

    Quote Originally Posted by ForeanXz View Post
    But then you are wrong, It may be used in HTML also, This is Javascript


    You don't use this in the PHP tags either..


    Its not like <?php

    $somestuff

    <script>

    </script>

    ?>

    That would be an error

    So No, it is NOT Php, It is Java.
    we'll you made ur point there,
    but still, i called it php because i always use php based web pages, and always add that code written in javascript in the php file

  7. #7
    人◕ ‿‿ ◕人 Forean is offline
    MemberRank
    Jul 2008 Join Date
    1,183Posts

    Re: [PHP] Anti-right click

    Quote Originally Posted by mugodz007 View Post
    we'll you made ur point there,
    but still, i called it php because i always use php based web pages, and always add that code written in javascript in the php file

    I will just leave it at that, Merry Late Christmas and "thanks" for the release.

  8. #8
    Account Upgraded | Title Enabled! Aiona is offline
    MemberRank
    Feb 2008 Join Date
    The NetherlandsLocation
    232Posts

    Re: [PHP] Anti-right click

    Quote Originally Posted by Phoenix View Post
    A message box would be annoying.

    Code:
     <SCRIPT language="JavaScript">
    <!--
    //Disable right click script
    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>
    i like to annoy people lol, so they wont try it again, and rage quit trying!

  9. #9
    I am THE DON Joe9099 is offline
    MemberRank
    Jan 2007 Join Date
    England, UkLocation
    3,655Posts

    Re: [JAVASCRIPT] Anti-right click

    I would never add this to my page

  10. #10
    Doggie And Rice. Military is offline
    MemberRank
    Jun 2009 Join Date
    Here and AboutLocation
    3,301Posts

    Re: [JAVASCRIPT] Anti-right click

    Came from Lloyd's page?

  11. #11
    Selfish Bastard Z1ls is offline
    MemberRank
    Aug 2009 Join Date
    WinlandLocation
    2,049Posts

    Re: [JAVASCRIPT] Anti-right click

    kinda useless release, cuz u can just google it...

  12. #12
    PENTAKILL Scratch is offline
    MemberRank
    Oct 2008 Join Date
    LiverpoolLocation
    3,173Posts

    Re: [JAVASCRIPT] Anti-right click

    CTRL+U ftw <3

  13. #13
    人◕ ‿‿ ◕人 Forean is offline
    MemberRank
    Jul 2008 Join Date
    1,183Posts

    Re: [JAVASCRIPT] Anti-right click

    Quote Originally Posted by Rejected View Post
    CTRL+U ftw <3

    Agree'd unless you added this.



    Credits : ArrayStudio.Com
    Code:
    <script language="JavaScript">
    function disableCtrlKeyCombination(e)
    {
            //list all CTRL + key combinations you want to disable
            var forbiddenKeys = new Array(‘a’, ‘n’, ‘u’, ‘c’, ‘x’, ‘v’, ‘j’);
            var key;
            var isCtrl;         if(window.event)
            {
                    key = window.event.keyCode;     //IE
                    if(window.event.ctrlKey)
                            isCtrl = true;
                    else
                            isCtrl = false;
            }
            else
            {
                    key = e.which;     //firefox
                    if(e.ctrlKey)
                            isCtrl = true;
                    else
                            isCtrl = false;
            }
             //if ctrl is pressed check if other key is in forbidenKeys array
            if(isCtrl)
            {
                    for(i=0; i<forbiddenkeys .length; i++)
                    {
                            //case-insensitive comparation
                            if(forbiddenKeys[i].toLowerCase() == String.fromCharCode(key).toLowerCase())
                            {
                                    alert(‘Key combination CTRL + ‘
                                            +String.fromCharCode(key)
                                            +‘ has been disabled.’);
                                    return false;
                            }
                    }
            }
            return true;
    }
    </script>

  14. #14
    hey Irahnik is offline
    MemberRank
    Mar 2010 Join Date
    127.0.0.1Location
    1,680Posts

    Re: [JAVASCRIPT] Anti-right click

    you can google this, yes.
    however this release secures your website from getting leeched from people you don't want your stuff to get leeched from [wahahaha].
    so, i like this. good job.

  15. #15
    Account Upgraded | Title Enabled! Aiona is offline
    MemberRank
    Feb 2008 Join Date
    The NetherlandsLocation
    232Posts

    Re: [JAVASCRIPT] Anti-right click

    Quote Originally Posted by LolIrvin View Post
    you can google this, yes.
    however this release secures your website from getting leeched from people you don't want your stuff to get leeched from [wahahaha].
    so, i like this. good job.
    thanks :)



Page 1 of 2 12 LastLast

Advertisement