+ Reply to Thread
Page 1 of 2 1 2 LastLast
Results 1 to 10 of 20

Thread: Preventing Right CLicks

  1. #1
    Senior Member inworx is on a distinguished road
    Join Date
    Mar 2007
    Posts
    156

    Preventing Right CLicks

    This is a simple javascript code which I made to prevent right clicks on your site..

    <script language="Javascript1.2">
    // Set the message for the alert box
    am = "Right click feature disabled. By inworx";
    // do not edit below this line
    // ===========================
    bV = parseInt(navigator.appVersion)
    bNS = navigator.appName=="Netscape"
    bIE = navigator.appName=="Microsoft Internet Explorer"
    function nrc(e) {
    if (bNS && e.which > 1){
    alert(am)
    return false
    } else if (bIE && (event.button >1)) {
    alert(am)
    return false;
    }
    }
    document.onmousedown = nrc;
    if (document.layers) window.captureEvents(Event.MOUSEDOWN);
    if (bNS && bV<5) window.onmousedown = nrc;
    </script>
    <script language="Javascript1.2">
    // Set the message for the alert box
    am = "Site Security: for security reasons this feature is disabled.";
    // do not edit below this line
    // ===========================
    bV = parseInt(navigator.appVersion)
    bNS = navigator.appName=="Netscape"
    bIE = navigator.appName=="Microsoft Internet Explorer"
    function nrc(e) {
    if (bNS && e.which > 1){
    alert(am)
    return false
    } else if (bIE && (event.button >1)) {
    alert(am)
    return false;
    }
    }
    document.onmousedown = nrc;
    if (document.layers) window.captureEvents(Event.MOUSEDOWN);
    if (bNS && bV<5) window.onmousedown = nrc;
    </script>

  2. #2
    Senior Member chandni_aqua is on a distinguished road
    Join Date
    Mar 2007
    Posts
    119
    hey thanks a lot, i was looking out for something like this since long... i would wanna use it for my website at the earliest

  3. #3
    Banned louj is on a distinguished road
    Join Date
    Mar 2007
    Posts
    139
    It is a good way to prevent your site from being duplicated. Thanks for the tip and the codes.

  4. #4
    Junior Member zeroaccess is on a distinguished road
    Join Date
    Mar 2007
    Posts
    13
    thanx for sharing the script mate. wanted a script like this from a long time . i'll use it on my blog as soon as possible thnx.....

  5. #5
    Junior Member Mastermanandy is on a distinguished road
    Join Date
    Mar 2007
    Posts
    22
    Wow thanks for this its perfect, now no-one else can steal stuff from my site

  6. #6
    Member atulperx is on a distinguished road
    Join Date
    Mar 2007
    Posts
    37
    Hi thanks for this script , i will use it on my blog because i have faces some problems with copy if my article earlier from other bloggers .

  7. #7
    Junior Member Mastermanandy is on a distinguished road
    Join Date
    Mar 2007
    Posts
    22
    Hmm, it seems that this doesnt work with all browsers, I checked it with opera just now and it wouldn't work. Although im sure with a little bit of editing it can be possible to block any browser from right-clicking.

  8. #8
    Member atulperx is on a distinguished road
    Join Date
    Mar 2007
    Posts
    37
    I am using firefox and my blog is hosted on blogspot and this script didn't worked on it also and friend sorry for typing failure of your script .

  9. #9
    Junior Member Mastermanandy is on a distinguished road
    Join Date
    Mar 2007
    Posts
    22
    If you can see, the script is only designed to work with Netsape and IE, so you would have to edit it manually to add any other browsers.

  10. #10
    Junior Member paypal is on a distinguished road
    Join Date
    Mar 2007
    Posts
    22
    This script would not work if the browser has JavaScript disabled. (And, it isn't too difficult to disable JavaScript on a browser either.)

+ Reply to Thread
Page 1 of 2 1 2 LastLast

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53