I got a Javascript code, which can be used to do this. Just copy-page below code in a head section of your page.
<script language="JavaScript">
var message="Right click Disabled!";
function checkIEBrowser()
{
if (event.button==2)
{
alert(message);
return false;
}
}
function checkOtherBrowser(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=checkOtherBrowser;
}
else if (document.all&&!document.getElementById)
{
document.onmousedown=checkIEBrowser;
}
document.oncontextmenu=new Function("alert(message);return false");
</script>
Output
![](http://1.bp.blogspot.com/_b0xJ7qk6DTc/TG90pU_i9JI/AAAAAAAAA4A/3TSvL5japaI/s1600/tag_blue.png)
Responses
0 Respones to "Javascript : Disable right click"
Post a Comment