| Script | Description | Script | Description | Script | Description |
|---|---|---|---|---|---|
| 1 | oncontextmenu | 2 | oncontextmenu alert box |
3 | oncontextmenu key event |
| 4 | oncontextmenu alert box key event |
5 | oncontextmenu images only |
6 | oncontextmenu images only key event |
| 7 | oncontextmenu, images only, alert box, key event | ||||
The script on this page will disable the right click for images only. An alert box IS triggered. This script is an extension of Script 6.
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 omdhan( evnt )
{
if( evnt.which == 3 )
{
alert( "No Right Click" );
return false;
}
}
function ocmhan()
{
alert( "No Right Click" );
return false;
}
function tagimg()
{
if( document.layers )
{
for( i = 0; i < document.images.length; i++ )
document.images[i].onmousedown = omdhan;
}
else
{
for( i = 0; i < document.images.length; i++ )
document.images[i].oncontextmenu = ocmhan;
}
}
</script>
<body onload="tagimg()">
| Browser Type | Works | Browser Type | Works |
|---|---|---|---|
| Internet Explorer 6.0 | Yes | Internet Explorer 5.5 | Yes |
| Mozilla .9, 1 | Yes | Netscape 4.7 | Yes |
| Netscape 6.2 | Yes | Opera 6, 7 | No |
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.