Link to home
Start Free TrialLog in
Avatar of salur
salur

asked on

Disabling the right click menu options in a brower

How do I disable the menu options when I right click on a browser ?

Secondly is there any way I can disable the BACK/FORWARD buttons thro HTML..
Avatar of xabi
xabi

Here goes the code for the right click (even on images and links) NN & IE.

..
..
<script language="JavaScript1.1">
<!--
var ns4 = (document.layers)? true:false
var ie4 = (document.all)? true:false
function press(e) {
  if ((ns4 && (e.which == 3 || e.which == 2)) || (ie4 && (event.button == 2 || event.button == 3))) return false
  return true
}
for (var i=0; i<document.images.length; i++) document.images[i].onmousedown=press
for (var i=0; i<document.links.length; i++) document.links[i].onmousedown=press
document.onmousedown=press
if (ns4) window.captureEvents(Event.MOUSEDOWN)
window.onmousedown=press
//-->
</script>
</head>
<body oncontextmenu="return false">
..
..
You can't disable back and forward buttons you can only create a new window without this buttons.

xabi
ASKER CERTIFIED SOLUTION
Avatar of XxEvilxX
XxEvilxX

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial