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
Labels: Javascript
Responses
0 Respones to "Javascript : Disable right click"
Post a Comment