How to Disable Right Click on HTML Page

We can disable the Right Click menu option by using the below Javascript code

<script type="text/javascript">

<!--

//Disable right click script

var message="Sorry, right-click has been disabled";

function clickIE() {if (document.all) {;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>

Just add the above code for disabling right click


Related Topic How to Enable, Disable Google +1
How to Install Eclipse with Android plugin
How to Disable( Delete ) Facebook Account
Javascript Code for Disabling Mouse Right Click Menu
How to Disable Right Click Javascript without Alert

nScraps.com 2011   Privacy Policy  Terms of Service  Feedback