Tuesday, 7 March 2017

How to Disable Right Click on your Website.


Today I am Going to tell you how to disable Right Click on your Web Page. Its a Javascript code by
using this you can easily disable right click on your web page.


<script language="JavaScript">

var message="Right Click Disabled";

function clickIE7(){
if (event.button==2){
alert(message);
return false;
}
}

function clickNS6(e){
if (document.layers||document.getElementById&&!document.all){
if (e.which==3||e.which==4){
alert(message);
return false;
}
}
}

if (document.layers){
document.captureEvents(Event.MOUSEDOWN);
document.onmousedown=clickNS6;
}
else if (document.all&&!document.getElementById){
document.onmousedown=clickIE7;
}

document.oncontextmenu=new Function("alert(message);return false")

</script>

0 comments:

Post a Comment