🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: microsoft.public.inetsdk.programming.scripting.jscript
Article #13

rightclick of links, buttons, etc..

#13
From: Rafael Rasinger
Date: Fri, 01 Oct 1999 00:00
54 lines
2402 bytes
Dear reader!

I am kind of new in the JS business and have encountered the following
problem.
The idea of the JScript is to call a (help-)page when clicking the right
mouse button over a link, button, etc... in both browsers (MSIE and NN). The
code below does it but unfortunately
1) whereever I click the right mousebuttton in the browser window the new
window is opened
2) and in MSIE additionally to the window, the context menu appears.

My
1) How can I prevent the context menu from being opened in MSIE?
2) How can I start the function only when a link, button, etc. is
rightclicked (when leftclicked a default action is performed)?

Thax a lot!

Rafael

***************
<HTML>
<BODY>


<SCRIPT LANGUAGE=javascript>

if (document.layers)
    document.captureEvents(Event.MOUSEDOWN);

  document.onmousedown =
      function ButtonClick(evt) {
      if ((document.layers && evt.which == 3) || (document.all &&
event.button == 2))
      {

window.open("help.html","HELP","height=200,width=400,status=no,scrollbars=ye
s");
       return false;
      }

     };

</SCRIPT>

<a href="help.html" onMousedown="ButtonClick()">Verweis</a>

<FORM>
<input type=button value="push" onMousedown="Clique()">
</FORM>

</BODY>
</HTML>
***************
Technical Details
Message-ID: <37f4b2f4@news.kapsch.co.at>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10d4a5,5999b3778b037568,start
X-Google-Attributes: gid10d4a5,public
X-Google-Thread: 10731d,5999b3778b037568,start
X-Google-Attributes: gid10731d,public
X-Google-Thread: fcc66,5999b3778b037568,start
X-Google-Attributes: gidfcc66,public
X-Google-Thread: 10c71c,5999b3778b037568,start
X-Google-Attributes: gid10c71c,public
X-Google-Thread: fb3cb,5999b3778b037568,start
X-Google-Attributes: gidfb3cb,public
From: "Rafael Rasinger" <rasinger@atc.co.at>
Subject: rightclick of links, buttons, etc..
Date: 1999/10/01
Message-ID: <37f4b2f4@news.kapsch.co.at>
X-Deja-AN: 531529781
X-Original-NNTP-Posting-Host: 193.80.86.140
X-Trace: 1 Oct 1999 15:11:16 +0100, 193.80.86.140
Organization: Kapsch AG; Vienna, Austria
X-MSMail-Priority: Normal
X-Priority: 3
Newsgroups: microsoft.public.inetsdk.programming.scripting.jscript,microsoft.public.scripting.jscript,borland.public.intrabuilder.javascript,comp.lang.javascript,de.comp.lang.javascript
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300
X-Complaints-To: abuse@kapsch.net