+ Reply to Thread
Results 1 to 6 of 6

Thread: No right click allowed . IT does not work??

  1. #1
    Join Date
    Jan 2010
    Posts
    15

    Default No right click allowed . IT does not work??

    I want to put this java code on my website So that pleople cant right click.

    But no matter where i put it it does not work
    This is the code please tell me where to put this code.


    <script language="JavaScript1.1">
    // distributed by http://www,hypergurl.com <!-- var debug = true; function
    right(e) { if (navigator.appName == 'Netscape' && (e.which == 3 || e.which
    == 2)) return false; else if (navigator.appName == 'Microsoft Internet Explorer'
    && (event.button == 2 || event.button == 3)) { alert('This Page is fully
    protected!'); return false; } return true; } document.onmousedown=right; if (document.layers)
    window.captureEvents(Event.MOUSEDOWN); window.onmousedown=right; //--></script>

  2. #2
    Join Date
    Aug 2007
    Location
    United States
    Posts
    10,470

    Default

    Wow that's old...

    For the record, disabling the right click via that method will not be very good and in fact is somewhat pointless as, well if you hold left and then right click and release left, it will work, if you press shift I think it is and right click then it will work and in most cases if you press the right click key on your computer keyboard (most have it) it will work. Plus that doesn't go to say using the View Source option wouldn't get the source to what is wanted anyways.

    You should really consider other options, for instance what is it you're trying to protect anyways?
    Login or Billing issues? File a support ticket via: http://byethost.com/support.php

    Free domain - Get yours today!


  3. #3
    Join Date
    Sep 2008
    Posts
    1,392

    Default

    Quote Originally Posted by mtp_admin View Post
    the right click key on your computer keyboard
    that's called a menu key
    where the ████ are country flags? thanks? I was following my thanks, thanks!

    Free Host ¶⁋¶⁋¶⁋ Problem solved? Post the solution!¶⁋¶⁋¶⁋Free Domain

  4. #4
    Join Date
    Jan 2010
    Posts
    15

    Default

    I am trying to protect my source code and i dont want people to be able to able to right click.
    i know if you really want to you can get around it. but just to be on the safe side please tell me code that will work.
    Please please please

    Ok so no one can help mE?

  5. #5
    Join Date
    Aug 2007
    Location
    United States
    Posts
    10,470

    Default

    Quote Originally Posted by irshad View Post
    I am trying to protect my source code and i dont want people to be able to able to right click.
    i know if you really want to you can get around it. but just to be on the safe side please tell me code that will work.
    Please please please

    Ok so no one can help mE?
    Google it then, I will tell you now though its pointless as 1) most code out there assumes there are only 2 browsers, 2) it is well known how to get around it and 3) it will only serve to annoy your real users.

    Quote Originally Posted by liquider View Post
    that's called a menu key
    Let's see, how many times do I need to use that key? Probably about five times in my life so is it important enough for me to know its official name? Not really.

    Oh and the Windows Key is a Super key, Command or Meta key to me... not that I use it either.
    Login or Billing issues? File a support ticket via: http://byethost.com/support.php

    Free domain - Get yours today!


  6. #6
    Join Date
    Nov 2007
    Location
    127.0.0.1
    Posts
    2,761

    Default

    Well here's a really simple script that you can use to block all access to the context menu (not just from the right mouse button but from the keyboard as well) and really annoy your visitors. The script is even simpler than most of the ones that only block the mouse button and works in about as many browsers as those scripts do [IE]. Here's the entire script for you.

    <body oncontextmenu="return false;">

    Source:
    http://javascript.about.com/library/blnoright.htm
    Last edited by stix; 09-01-2010 at 05:28 AM.

+ Reply to Thread

Posting Permissions

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