Home » » how to disable mouse right click with javascript

how to disable mouse right click with javascript

Unknown | 2:28 PM | 0 comments





You can lock the right click mouse and user or visitors can not copy and paste the info on your website.



Instructions:-

1- Copy the next code.
2- paste it inside the "<head>" tag in your page.
3- save and run.


Compatible browsers:

<SCRIPT LANGUAGE="JavaScript">
var message="Function Disabled!";
///////////////////////////////////
function clickIE() {if (document.all) {alert(message);return false;}}
function clickNS(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=clickNS;}
else{document.onmouseup=clickNS;document.oncontextmenu=clickIE;}

document.oncontextmenu=new Function("return false")
// --> 
</script>
Share this article :

0 comments:

Post a Comment

Notice : Spam Comments Will Be Deleted

 
Copyright © 2012. CodeSlot - All Rights Reserved
Template By Phoenix.Elmasry
Powered By Blogger