Javascript code to disable the right click menu in web browser

We have used this script to disable the right click menu (and thus take away the "view source" window). This works with all major browsers.

<!-- this script got from by: Krishna Eydat -->


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.oncontextmenu=new Function("return false")

// -->