Solved

Disabling the right click menu options in a brower

Posted on 2000-02-15
2
171 Views
Last Modified: 2010-04-09
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..
0
Comment
Question by:salur
2 Comments
 
LVL 8

Expert Comment

by:xabi
ID: 2526038
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
0
 

Accepted Solution

by:
XxEvilxX earned 50 total points
ID: 2529808
hey a small code

<SCRIPT language=JavaScript1.1>
<!-- Begin
function right(e) { if (navigator.appName == 'Netscape' && (e.which == 3 || e.which == 2)) return false; else if (navigator.appName == 'Microsoft Internet Explorer' && (event.button == 2 || event.button == 3)) { alert("... Dont do that!!"); return false; } return true; } document.onmousedown=right; if (document.layers) window.captureEvents(Event.MOUSEDOWN); window.onmousedown=right;
// End -->
</SCRIPT>
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Suggested Solutions

Showing your events from Google Calendar in Google Maps Why? I travel all week and I thought it would be ideal if staff in office knew where I was based on my calendar. (OK real reason: my son wanted to see where I would be working, and I thoug…
This article explains how to prepare an HTML email signature template file containing dynamic placeholders for users' Azure AD data. Furthermore, it explains how to use this file to remotely set up a department-wide email signature policy in Office …
In this tutorial viewers will learn how to position overlapping items using z-index in CSS. They will also learn the restrictions on the z-index property.  Create a new HTML document with an internal stylesheet.: Create a div in CSS and name it Red.…
In this tutorial viewers will learn how to code links for mobile sites that, once clicked, send a call or text to a specified number. For a telephone link (once clicked, calls a number), begin with a normal "<a href=" link tag. For the href, specify…

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now