Sunday, 10 November 2013

Disabling right click with a message...

Here what I am gonna show is a javascript, If you want to use it in your website then paste the following code anywhere in the <head> section. And if you want to apply it on blogger then simply go to "layout" and add a widget named "HTML/Javascript", and paste this code:




<script language=javascript>
<!--
var message="[your message goes here]";
function clickIE()
{
  if (document.all) {
    (message);return false;}
}
function clickNS(e)
{
if (document.layers||(document.getElementById&&!document.all)) {
  if (e.which==2||e.which==3) {(message);return false;}}
}
if (document.layers){
  document.captureEvents(Event.MOUSEDOWN);document.onmousedown=clickNS;}
else{
  document.onmouseup=clickNS;document.oncontextmenu=clickIE;}
document.oncontextmenu=new Function("return false")
// -->
</script>

No comments:

Post a Comment

Popular Posts