Tuesday, 29 October 2013

Disable right click on blog

Posted by Amit Pithadia On 07:52 No comments
Sometime we may be frustrate that why other are copying our work and attracting good traffic to their blog. Further, they are also not giving due credit to you or back link to you. You might have been noticed that many has disabled the right click to prevent the copy. Here i can show you have you can disable right click in your blog to in very simple way.












Steps to disable right click on blog


  1) Go to your Dashboard

  2) Go to Layout and click on "Add a Gadget" any where in the layout

  3) Now click on HTML and paste the following code.

<script language="JavaScript">
<!--

//Disable right mouse click Script
//For full source code, visit http://www.thenetmatrix.com

var message="Function Disabled!";

///////////////////////////////////
function clickIE4(){
if (event.button==2){
alert(message);
return false;
}
}

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

if (document.layers){
document.captureEvents(Event.MOUSEDOWN);
document.onmousedown=clickNS4;
}
else if (document.all&&!document.getElementById){
document.onmousedown=clickIE4;
}

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

// </script>
--&gt;

Instead of "Function Disabled" you can put any other message in the above HTML which you would like to show whenever reader try to right click.

Now the message will show whenever the reader will try right click.

0 comments:

Post a Comment

  • RSS
  • Delicious
  • Digg
  • Facebook
  • Twitter
  • Linkedin
  • Youtube