Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    New to the CF scene
    Join Date
    Nov 2005
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Disabling clicks

    How do I disable clicking with teh right hand side of the mouse. I know it is possible but I dont know how.

  • #2
    Senior Coder missing-score's Avatar
    Join Date
    Jan 2003
    Location
    UK
    Posts
    2,194
    Thanks
    0
    Thanked 0 Times in 0 Posts
    In the future you should try searching the forums:

    Q. How can I use Javascript to protect my web pages?

    A. Short answer, you can't.

    Long Answer:

    Since visitors to your web site can disable Javascript in their browser, javascript can't be used as a protection mechanism.

    Even without disabling Javascript I can easily see the whole code for your web page by simply running another javascript which will undo anything you did to make the page unavailable. Search for "Bookmarklets" in Google for a bunch of simple but useful scripts like that which can be set up as Bookmarks (Favorites for you IE users).

    Please note that "No Right Click" scripts (one of the favorite uses of javascript to "protect" a web page) are considered at best a "waste of time" but more often as "user antagonistic" by most of the regulars here. You can get answers on how to write them, fix them and the like eventually but you may find yourself running a gauntlet of questions about why you would want to do such a thing before you get assistance. Scripts that make it harder to provide help do not endear you to the volunteers who provide the help.
    There also several dicussions on the topic. The simple fact is, while you can disable the right click, its a useless thing to do, as its very easy to get round. I have a bookmarklet (A bookmark that runs some kind of JavaScript code), and by clicking this bookmark all no-right-click scripts are disabled.

  • #3
    Senior Coder
    Join Date
    Jun 2002
    Location
    The Netherlands, Baarn, Ut.
    Posts
    4,252
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Rude

    Besides that, interfering with the user's interface like that and messing up the -very useful!!!- context menu is very rude.
    Regards,
    Ronald.
    ronaldvanderwijden.com

  • #4
    Rockstar Coder
    Join Date
    Jun 2002
    Location
    USA
    Posts
    9,074
    Thanks
    1
    Thanked 328 Times in 324 Posts
    While I also strongly believe against the idea the other posters in this thread, if you still really want to do it you'll need some javascript to do it. You can probably find the code by searching google pretty easy for javascript "disable right click"
    OracleGuy

  • #5
    Regular Coder
    Join Date
    Oct 2005
    Location
    NYgamers.net
    Posts
    108
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Despite your best attempts to prevent the user from getting your info please realize that they already have it in their cache and there is nothing you can do to prevent them from just pulling the content from that locale.

    Sorry


  •  

    Posting Permissions

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