Jump to content
xisto Community
Sign in to follow this  
ZeroHawk

How Do You Disable Right Clicking?

Recommended Posts

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

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

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

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.