Saturday, 27 October 2012

How to disable Right Clicks in your Website or Blog

Sometimes you may need to disable right clicks on your pages, may be to disable copying of contents or to disable other such events.
Well to do this a need to install a script. For Blogger, you have to install a "HTML/Java Script" widget and copy the code in that.

You can add your custom message by replacing the text in RED in the script  ("Function Disabled!").


<script language=JavaScript>

//Disable right mouse click Script

var message="Function Disabled!";

function clickIE4(){
if (event.button==2){
return false;

function clickNS4(e){
if (document.layers||document.getElementById&&!document.all){
if (e.which==2||e.which==3){
return false;

if (document.layers){
else if (document.all&&!document.getElementById){

document.oncontextmenu=new Function("alert(message);return false")

// -->

No comments:

Post a comment

Any queries /Suggestions? Please Feel Free To Comment...