1. No Profile Picture
    Devshed Newbie (0 - 499 posts)
    I was once on a page were everytime you used right-click an aler message came and I couldn't use any teh mouse button. (Pretty effectively stopping me from using any of the options that are in the dropdown menu normally displayed)
    Sadly I can't find the page any longer, so, anybody here has any idea???

    SORRY!!! I just found out that this has been discussed already!!! SORRY!!! In case anybody wants the code anyway:

    <script language="JavaScript1.2">

    /*Disable right mouse click Script© Dynamic Drive (www.dynamicdrive.com)
    For full source code, installation instructions, 100's more DHTML scripts, and
    Terms Of Use, visit dynamicdrive.com This script last updated:99/04/05
    */ if (document.all) document.body.onmousedown=new Function("if (event.button==2|
    |event.button==3)alert('The right mouse button has been disabled')")

    [This message has been edited by Chriss (edited 12-10-99).]
  2. #2
  3. No Profile Picture
    Devshed Newbie (0 - 499 posts)
    using no right click on a site is useless.
    anyone with half a brain can view your source. all it really does is stop the novice from viewing your source or grabbing your images.

  4. #3
  5. No Profile Picture
    Devshed Newbie (0 - 499 posts)
    I am quite aware of that, but if it's just the novices it's at least a start, isn't it? Plus, if you place the code right, use some frames and additional JavaScripting it can be real useful...
    Unfortunately the code I found doesn't quite work, so if anybody could help me with that I'd highly appreciate it! If I simply copy&paste it I get an error message in both NE4.7 and IE5, if I remove the "body" in the fist line it works only in IE5 and not in NE, anybody knows why???

  6. #4
  7. No Profile Picture
    Devshed Newbie (0 - 499 posts)
    you are checking if (document.all). That implies IE. If you want to make this work for NS, you need to check for (document.layers). You also need to use captureEvents() and then assign a function to event.CLICK.

    I know this is a little cryptic, but with a little more digging, you can find sample code all over the place for this.

Similar Threads

  1. Replies: 11
    Last Post: January 2nd, 2004, 02:40 PM
  2. Linking to an Excel document from IE
    By bluesphee in forum HTML Programming
    Replies: 3
    Last Post: August 5th, 2003, 02:25 PM
  3. inserting javascript into html document
    By davidgraham16 in forum JavaScript Development
    Replies: 7
    Last Post: January 24th, 2003, 04:57 AM
  4. embed php generated html in another html page
    By s7eve77 in forum PHP Development
    Replies: 21
    Last Post: March 7th, 2002, 05:43 AM
  5. Single click to open the Source of HTML
    By peterbe in forum HTML Programming
    Replies: 1
    Last Post: August 18th, 2000, 12:52 AM

IMN logo majestic logo threadwatch logo seochat tools logo