aamberker Posted October 13, 2006 Share Posted October 13, 2006 Hi,Kindly help me to get the CODE for "No Right Click" ... In other words, how do I protect Graphic Images under web Pages?With Warm Regards,Amit ~ Link to comment Share on other sites More sharing options...
aspnetguy Posted October 13, 2006 Share Posted October 13, 2006 in short you can't, disabling right click only slows them down...they can just look at your source and see the path Link to comment Share on other sites More sharing options...
www.mihalism.com Posted October 13, 2006 Share Posted October 13, 2006 No reason to have it because there are so many ways around itwell heres the script <script language=JavaScript><!--var message="Sorry, no right-clicking allowed.";function clickIE4(){if (event.button==2){alert(message);return false;}}function clickNS4(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=clickNS4;}else if (document.all&&!document.getElementById){document.onmousedown=clickIE4;}document.oncontextmenu=new Function("alert(message);return false")// --></script> Link to comment Share on other sites More sharing options...
aamberker Posted October 14, 2006 Author Share Posted October 14, 2006 Hi aspnetguy and www.mihalism.comThank you for your response. www.mihalism.com, under the code you have mentioned as "function clickIE4" but you see, I am using IE version 6.0 ... wheww!... So? And moreover what you think on the following code?<script language="JavaScript"><!--var message="YOUR MESSAGE!";function click(e) {if (document.all) {if (event.button==2||event.button==3) {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>With Warm Regards,Amit ~ Link to comment Share on other sites More sharing options...
justsomeguy Posted October 14, 2006 Share Posted October 14, 2006 I think that the code is useless because there are at least 10 ways to get the page source and/or graphics used on a web page. One way is File->Save. Another way is to use the Opera browser, which, by default, does not allow Javascript to receive right-clicks.If you don't want someone to have an image, then don't put it online. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now