Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. How Disable Right Click on Webpage ??

How Disable Right Click on Webpage ??

Scheduled Pinned Locked Moved Web Development
javascripthtmltoolsquestion
5 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    denishverma
    wrote on last edited by
    #1

    Code which is used to Disable the right click Button on web-page. --------------------------------------- <script type="text/javascript"> <!--// function press() { if (event.button==2) { alert('Sorry, Right click is not allowed') return false; } } document.onmousedown=press //--> </script> --------------------------------------- Just add this in HTML code after Head Tag. Give me comment and suggestions other than this. Regards Dinesh Verma

    S 1 Reply Last reply
    0
    • D denishverma

      Code which is used to Disable the right click Button on web-page. --------------------------------------- <script type="text/javascript"> <!--// function press() { if (event.button==2) { alert('Sorry, Right click is not allowed') return false; } } document.onmousedown=press //--> </script> --------------------------------------- Just add this in HTML code after Head Tag. Give me comment and suggestions other than this. Regards Dinesh Verma

      S Offline
      S Offline
      saanj
      wrote on last edited by
      #2

      Hi, Just have a look at the following codeproject article. I am sure it will help. Disabling the right click on web page[^]

      Either you love IT or leave IT...

      N 1 Reply Last reply
      0
      • S saanj

        Hi, Just have a look at the following codeproject article. I am sure it will help. Disabling the right click on web page[^]

        Either you love IT or leave IT...

        N Offline
        N Offline
        nickmaroulis
        wrote on last edited by
        #3

        Just out of interest... why would you want to disable the right click? Any web programmer knows that code rendered in a browser can not be hidden! All the functionality in right click is available in the menu bar.

        S 1 Reply Last reply
        0
        • N nickmaroulis

          Just out of interest... why would you want to disable the right click? Any web programmer knows that code rendered in a browser can not be hidden! All the functionality in right click is available in the menu bar.

          S Offline
          S Offline
          saanj
          wrote on last edited by
          #4

          I hope your reply pointed towards Denish's post. :)

          Either you love IT or leave IT...

          N 1 Reply Last reply
          0
          • S saanj

            I hope your reply pointed towards Denish's post. :)

            Either you love IT or leave IT...

            N Offline
            N Offline
            nickmaroulis
            wrote on last edited by
            #5

            Yeah it was

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups