Date:  07/27/2002 08:25:22 PM Msg ID:  000773
From:  Joe Goldsmith Thread:  000773
Subject:  Disable Right Click
Whee, I finally found a way to disable right-click to protect my code and I share it with you. Works in both .HTM and .FWX. I place it in a .txt file and call it using <%=FILETOSTR('disablerightclick.txt')%> just after teh body tag.
 
Enjoy
 
Joe
 
************************
code before body
...
<BODY>
<script language=JavaScript>
<!--
var message="Right-Click 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>
...
code after script