View Complete Thread | FoxWeb Forum Home
Search:
Date:    Msg ID:   
From:    Thread:   
Subject:   
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