This script code will allow you to disable the right mouse click by
adding it between your body tags <body></body>
___________________________________________________________________________
Disable Right Click on My Website
- Dragosvr92
- Administrator
- Posts: 1128
- Joined: 11 Sep 2009, 06:04
- Name: Dragoș-Valentin Rădulescu
- Location: Romania
- Age: 32
- Contact:
Disable Right Click on My Website
Post #1 » 1 decade 4 years ago (29 Nov 2009, 22:42)
Formerly known as TheKiller
- Dragosvr92
- Administrator
- Posts: 1128
- Joined: 11 Sep 2009, 06:04
- Name: Dragoș-Valentin Rădulescu
- Location: Romania
- Age: 32
- Contact:
Re: Disable Right Click HTML Code
Post #2 » 1 decade 4 years ago (29 Nov 2009, 22:46)
To Disable The Right click by HTML Use the fallowing code
Keywords: Disable The Right Click
Code: Select all
<BODY oncontextmenu="return false"</body>
Formerly known as TheKiller
- Dragosvr92
- Administrator
- Posts: 1128
- Joined: 11 Sep 2009, 06:04
- Name: Dragoș-Valentin Rădulescu
- Location: Romania
- Age: 32
- Contact:
Re: Disable Right Click Javascript
Post #3 » 1 decade 4 years ago (29 Nov 2009, 22:50)
Script To Disable The Right-Click On An HTML Page
This script code will allow you to disable the right mouse click by adding it between your body tags ~ <body></body>.And will also display a pop-up message.
Note : if you want to use the JS Code into an .js File just remove the tags
or you can use this shorter version
This script code will allow you to disable the right mouse click by adding it between your body tags ~ <body></body>.And will also display a pop-up message.
Note : if you want to use the JS Code into an .js File just remove the tags
Code: Select all
<script language=JavaScript>
</script>
___________________________________________________________________________
[code]<script language=JavaScript>
<!--
//Disable right mouse click Script
//By Maximus (maximus@nsimail.com) w/ mods by DynamicDrive
//For full source code, visit http://www.dynamicdrive.com
var message="Sorry But the Right Click is Disabled";
///////////////////////////////////
function clickIE4(){
if (event.button==2){
alert(message);
return false;
}
}
function clickNS4(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=clickNS4;
}
else if (document.all&&!document.getElementById){
document.onmousedown=clickIE4;
}
document.oncontextmenu=new Function("alert(message);return false")
// -->
</script>
Code: Select all
<script language=Javascript1.2> function ejs_nodroit()
{
alert('Sorry But the Right Click is Disabled');
return(false);
}
document.oncontextmenu = ejs_nodroit;
</script>
Formerly known as TheKiller