Date:  08/28/2002 03:16:46 PM Msg ID:  000846
From:  mike hood Thread:  000773
Subject:  Re: Disable Right Click
i havent tested that script but im sure it has the same flaw other scripts like it have had.  the script disables the right click 'view source' but not the browser menu option 'view source'.  i have seen the browser menu option disable but have never seen the kode that disables it. 
 
when you combine the right click disable and the browser disable you will have nearly unviewable source kode.  windows temporary internet files will have the source that can be read with a text editor.  most users will never go that route tho.
 
--=mh
Sent by John Waite on 08/26/2002 04:59:16 AM:
Dear Joe,
 
Thanks for this very useful snippet of code. Much appreciated. I shall let you know how iget on with it.
 
John
 
Sent by Joe Goldsmith on 08/24/2002 07:46:20 PM:
This one works for me in a page with 3 frames but I have to put it in each frame. I use <%=FILETOSTR('include/disablerightclick.txt')%> just after the <BODY>. Give it a try.
 
<BODY>
<%=FILETOSTR('include/disablerightclick.txt')%>
 
 
***FILE disablerightclick.txt***
<script language=JavaScript>
var message="";
function clickIE() {if (document.all) {(message);return false;}}
function clickNS(e) {if
(document.layers||(document.getElementById&&!document.all)) {
if (e.which==2||e.which==3) {(message);return false;}}}
if (document.layers)
{document.captureEvents(Event.MOUSEDOWN);document.onmousedown=clickNS;}
else{document.onmouseup=clickNS;document.oncontextmenu=clickIE;}
document.oncontextmenu=new Function("return false")
 </script>

Joe

Sent by Cas Nuy on 08/10/2002 05:35:40 AM:
Joe,
I tried it but it does not work. I am using frames, could that be the cause ?
 
Cas
Sent by Joe Goldsmith on 07/27/2002 08:25:22 PM:
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