ZeroHawk 0 Report post Posted October 29, 2005 How do you disable right clicking? I have no javascript knowledge, so can someone give me the full code? Thanks. Share this post Link to post Share on other sites
rvalkass 5 Report post Posted October 29, 2005 This is the code for disabling right click: <script language=JavaScript><!--var message="Function Disabled!";function rclickIE(){if (event.button==2){alert(message);return false;}}function rclickNS(e){if (document.layers||document.getElementById&&!document.all){if (e.which==2||e.which==3){alert(message);return false;}}}if (document.layers){document.captureEvents(Event.MOUSEDOWN);document.onmousedown=rclickNS;}else if (document.all&&!document.getElementById){document.onmousedown=rclickIE;}document.oncontextmenu=new Function("alert(message);return false")// --> </script> Change the line that says var message="Function Disabled"; to contain your message.e.g. var message="You are not stealing my stuff"; Hope that helps. Share this post Link to post Share on other sites
Becca 0 Report post Posted October 29, 2005 No java needed.. welli think not. <body onclick="return false"> might stop peopel from right clicking. Simple- no annoying popups.- not rightclicking Share this post Link to post Share on other sites
Arigato 0 Report post Posted October 29, 2005 There is really no effective way to hide source code. Disabling right click is a very old method of an attempt to hide source code or protect images and alot of people now know to get around that these days. On apple computers this is completely useless because they have no right click button. Share this post Link to post Share on other sites
ZeroHawk 0 Report post Posted October 30, 2005 Let's put it this way: the stuff I'm concerned about wouldn't be worth a workaround. Share this post Link to post Share on other sites
Red Alert 0 Report post Posted November 2, 2005 Worth a work around? All you have to do is click the "View" menu, then click "Source". No code can stop someone from doing that. That could be considered even easier that right click >view source .................................................. .................................................. .................................................. .................................................. .................................................. .................................................. .................................................. .................................................. Share this post Link to post Share on other sites