How to disable right click on a website

Disable Right click logo


Sometimes you may not want visitors to be able to right click and look at the source code on your website. As a practice this is generally discouraged and is considered nothing more than a nuisance, but in some cases it may be preferable, such as on a photography website to stop users from downloading copyrighted images for example. Implementing the code couldn’t be any easier, simply copy this code:
 oncontextmenu=”return false;” 
And add it to the opening tag of your website, I.E:
 <body false="" oncontextmenu="”return false;"> 
This will prevent the right click option being available in most web browsers, although some, such as Opera will still choose to ignore this command.

Blocking Right Click Using Javascript

You can also add javascript functionality to show alert box when right click...

For Example:
 <script type="text/javascript">
function RightClickDisable(){
alert("Right Click is Disable");
return false;
}
 </script>
and
 <body false="" oncontextmenu="”RightClickDisable()"> 



Previous
Next Post »