www.webdeveloper.com
Results 1 to 4 of 4

Thread: Does anybody know the code to stop people from right clicking on my site?

  1. #1
    Join Date
    Aug 2003
    Location
    Texas
    Posts
    1

    Question Does anybody know the code to stop people from right clicking on my site?

    Does anybody know the code to stop people from right clicking on my site?

  2. #2
    Join Date
    Aug 2003
    Location
    USA
    Posts
    19
    Here's the code to stop right click:

    Code:
    <html>
    <head>
    <script type="text/javascript">
    function disable()
    {
    if (event.button == 2)
    {
    alert("Sorry no rightclick on this page.\nYou cannot view my source\nand you cannot steal my images.")
    }
    }
    
    </script>
    </head>
    <body onmousedown="disable()">
    
    </body>
    </html>
    It is taken from http://www.w3schools.com/

  3. #3
    Join Date
    Nov 2002
    Location
    XYZZY - UK
    Posts
    1,760
    Close this topic quick because if I disable JavaScript on my browser the above fails…

  4. #4
    Join Date
    May 2003
    Posts
    550
    Search the forums...this has been discussed dozens of times. In the end, just about any method of stopping right clicks or protecting your client-side source code will backfire or can be gotten around with 2 minutes of effort.

Thread Information

Users Browsing this Thread

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

Posting Permissions

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



Recent Articles