No Right Click Script 4

ScriptDescription ScriptDescription ScriptDescription
1oncontextmenu 2oncontextmenu
alert box
3oncontextmenu
key event
4oncontextmenu
alert box
key event
5oncontextmenu
images only
6oncontextmenu
images only
key event
7oncontextmenu, images only, alert box, key event

The script on this page will completely disable the right click. An alert box IS triggered. This script is an extension of Script 2 to add support for Netscape 4.7x.

This is the code that is running on this page. Like the rest of these scripts it can easily be circumvented by turning off javascript or by using a browser that doesn't support javascript.

Cut and paste this code into the <head> part of your page.


<script type="text/javascript">

function ehan( evnt )
{
  if( evnt.which == 3 )
  {
    alert( "No Right Click" );
    return false;
  }
  return true;
}
function ocmh()
{
  alert( "No Right Click" );
  return false;
}
document.oncontextmenu = ocmh;
document.captureEvents( Event.MOUSEDOWN );
if( document.layers ) document.onmousedown = ehan;

</script>

Browser TypeWorks Browser TypeWorks
Internet Explorer 6.0Yes Internet Explorer 5.5Yes
Mozilla .9, 1Yes Netscape 4.7Yes
Netscape 6.2Yes Opera 6, 7No

MicroDrive Corporation is interested in extending this list. If you are viewing this page with a browser that is not listed please send us an email and tell us what browser you are using and whether it works or not. We will extend this table based on these reports. Thanks.

WebMaster@MicroDrive.com