2009/06/22

To disable right click on webpage

you can disable the right click on webpage using the following javascript code:

<script language="JavaScript1.1">

<!-- Begin function right(e)

{

if (navigator.appName == 'Netscape' && (e.which == 3 e.which == 2))

return false;

else if (navigator.appName == 'Microsoft Internet Explorer' && (event.button == 2 event.button == 3))

{

alert(" ");

return false;

}

return true;

}

document.onmousedown=right;

document.onmouseup=right;

if (document.layers) window.captureEvents(Event.MOUSEDOWN);

if (document.layers) window.captureEvents(Event.MOUSEUP);

window.onmousedown=right;

window.onmouseup=right;


// End -->
</script>

No comments: