ASP Programming | ASP Web Pro
  Active Server Pages Programming by ASP Web Pro

JavaScripts

DISBALE RIGHT-CLICK

If you want to deter users from copying the content from your website, this script will disable the right-click function on the users mouse. Of course, we say this is only a deterant because the user can change the settings in their browser and get around this. At least it helps to deter novices from stealing your work.

<HTML><HEAD>
<TITLE>ASP Web Pro</TITLE>
</HEAD>

<BODY>

<SCRIPT Language="JavaScript">
<!--
var message="Sorry, the right-click function is disabled.";
function click(e) {
if (document.all) {
if (event.button == 2) {
alert(message);
return false;
}
}
if (document.layers) {
if (e.which == 3) {
alert(message);
return false;
}
}
}
if (document.layers) {
document.captureEvents(Event.MOUSEDOWN);
}
document.onmousedown=click;
// -->
</SCRIPT>

</BODY>
</HTML>

< Back to JavaScripts


 

 

Main Menu
Home
ASP Scripts
ASP Tutorials
JavaScripts
Awards
Contact Us

Email This Page

Other Resources
ASP Web Hosting
Search Engine Submission
Programming Help

 

 

 

Other ASP Web Sites

Site Map

 

Last Updated:
28 August 2008