This free right click disable javascript will disable the right click popup. Also it will protect your web site content, resources from being copied. This free javascript code can be used in any html page.
Features
a) This javascript function will disable the right mouse click.
b) This will stop users from easily stealing your site content using view source.
c) You can add the message as you wish.
d) Just copy the code into your page and enjoy the effect.
Preview
Right click is disabled in this page. Test it by right clicking anywhere in this page.
Code
Code:
<!-- Script by hscripts.com -->
<!-- copyright of HIOX INDIA -->
<!-- more scripts @ http://www.hscripts.com -->
<script type="text/javascript">
<!-- Edit the message as your wish -->
var msg_box ="You dont have permission to copy";
function dis_rightclickIE(){
if (navigator.appName == 'Microsoft Internet Explorer' && (event.button == 2 || event.button == 3))
alert(msg_box)
}
function dis_rightclickNS(e){
if ((document.layers||document.getElementById&&!document.all) && (e.which==2||e.which==3))
{
alert(msg_box)
return false;
}
}
if (document.layers){
document.captureEvents(Event.MOUSEDOWN);
document.onmousedown=dis_rightclickNS;
}
else if (document.all&&!document.getElementById){
document.onmousedown=dis_rightclickIE;
}
document.oncontextmenu=new Function("alert(msg_box);return false")
</script>
<!-- Script by hscripts.com -->
For customization of this script or any script development, contact us at support@hscripts.com
Usage
a) Copy the code to the head tag of your file.
b) To customize your message then make changes in the following line,
var msg_box ="(Add your message here)";
c)This free "no right clicking" JavaScript is compatible with windows IE, firefox and mozilla.
License
- The javascript (misspelled as java script) is given under GPL License
- i.e. Free use for those who use the codes as it is.
- Free, if your modification does not remove our copyright information and links.
- Click Here for detailed license information.
- You can purchase the script if your requirements does not meet our GPL License terms.