Java Script Sample – Disable right mouse click
This code should come in handy for anyone that wants to make an attempt at protecting the content
of there website. Be warned though anything can be copied if you know how and an example of this is to
take a screen shot and edit this to suit. Anyway if you wish to add this code to your website just
follow the instructions below. The code will not be visible to your web page but will be hidden.
You will need a basic understanding of html to add this code into your webpage.
This java script will help you disable the right mouse click feature of your
visitors mouse. This is a great java script to protect images on your webpage’s.
Copy the code from <script language=”JavaScript”> to </script> (high lighted
in burgundy) and paste it into your webpage either in before the body tag or for
SBI Block Builders place it before your content.
<script language=JavaScript>
<!–
var message=”This action is not allowed and has been 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>
Don’t forget to browse our website for more free java script download code.
If there is something you need and you can’t find it please contact us via the
contact form and let us know what you’re looking for and I will do my best to
come up with a solution for you.
Java script code can be created for most needs its just a matter of creating good
code that can work on most web browsers which can be a mission on its own.
Another alternative is to browse the Internet for other usable code yo may be
looking for to do that specific job on your webpage.
Your are viewing the javascript disable right mouse click sample