View Single Post
Old 03-11-2007   #1 (permalink)
inworx
Senior Member
 
Join Date: Mar 2007
Posts: 160
Rep Power: 2 inworx is on a distinguished road
Default Preventing Right CLicks

This is a simple javascript code which I made to prevent right clicks on your site..

<script language="Javascript1.2">
// Set the message for the alert box
am = "Right click feature disabled. By inworx";
// do not edit below this line
// ===========================
bV = parseInt(navigator.appVersion)
bNS = navigator.appName=="Netscape"
bIE = navigator.appName=="Microsoft Internet Explorer"
function nrc(e) {
if (bNS && e.which > 1){
alert(am)
return false
} else if (bIE && (event.button >1)) {
alert(am)
return false;
}
}
document.onmousedown = nrc;
if (document.layers) window.captureEvents(Event.MOUSEDOWN);
if (bNS && bV<5) window.onmousedown = nrc;
</script>
<script language="Javascript1.2">
// Set the message for the alert box
am = "Site Security: for security reasons this feature is disabled.";
// do not edit below this line
// ===========================
bV = parseInt(navigator.appVersion)
bNS = navigator.appName=="Netscape"
bIE = navigator.appName=="Microsoft Internet Explorer"
function nrc(e) {
if (bNS && e.which > 1){
alert(am)
return false
} else if (bIE && (event.button >1)) {
alert(am)
return false;
}
}
document.onmousedown = nrc;
if (document.layers) window.captureEvents(Event.MOUSEDOWN);
if (bNS && bV<5) window.onmousedown = nrc;
</script>
inworx is offline   Reply With Quote