Disabled Right Click On Web Site

steps :

1) create simple application (html).

2) put the below javascript in to the code.

<script language="JavaScript">
      // on right click appear this message
      var DisplayMsg="Right Click Disabled";
      //return message
      function clickBYIE()
      {
          if(document.all)
          {
              alert(DisplayMsg);
              return false;
          }
      }
      //return message
      function clickBYNS(e)
      {
          if (document.layers||(document.getElementById&&!document.all))
          {
              if (e.which==2||e.which==3)
              {
               alert(DisplayMsg);
               return false;
              }
          }
      }

     //set the function as per browser
      if (document.layers)
      {
          document.captureEvents(Event.MOUSEDOWN);document.onmousedown=clickBYNS;
      }
      else
      {
          document.onmouseup=clickBYNS;document.oncontextmenu=clickBYIE;
      }
      //disabled the right click on the browser
       document.oncontextmenu=new Function("return false")
  </script>
run the code and check.
thnx
Advertisements

7 comments

  1. How do you make a simple application (html)?

    1. I am not getting what you say?

  2. He probably meant just a plain simple html file !! I haven’t tried this but will it work on WP ?

  3. Nicko ¢ρ¢нєαтѕяιgнтѕ ѕℓινєя мє∂αℓ ωιηηєя · · Reply

    It says you need to make a “simple html application”. How do you do this using a WordPress.com blog?!

  4. Michael · · Reply

    It won’t work for WordPress. You could just put the HTML code in a text widget and that would work. But it won’t because Javascript is disabled on WordPress.

  5. James Carpenter · · Reply

    Just whack the script into your header.php!

  6. hi would inserting this script mentioned stop right click downloads of video that is in a wordpress site?

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s