Disable Right Click On Your Website/Blog

Thursday, May 28, 2009,

Sometimes you have a blog that has images and posts that are attractive to copywriters. So you can disable right click so that they can't simply copy paste your images or some other stuff from your blog. The code is brought to you by www.dynamicdrive.com.

Right Click Disabling :

<script language=JavaScript>
<!--


var message="Right-clicking is not permitted!";

///////////////////////////////////
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>
Just copy and paste the above script into your blog's body section and you'll get the required results.

Related search...


blog comments powered by Disqus