Right-click context menu that can pass values when right-clicking a link??

Discussion in 'Javascript' started by Leon, Nov 25, 2004.

  1. Leon

    Leon Guest

    Is it possible?

    We have a list of suppliers link like

    A supplier
    B supplier

    when right click on a supplier, a context menu(that has
    "details","view products", etc) appears and click on "view products
    for this supplier" this click will redirect users to products page
    showing all products from the supplier.

    So href should look some like this
    <a href="RightClicked('10')">A supplier</a>

    function RightClicked(supplierID)
    // don't know I am making this up here
    if (viewDetailsClicked)
    else if (viewProducts)

    Can it be done, does anyone have the script?

    Thanks a lot
    Leon, Nov 25, 2004
    1. Advertisements

  2. Leon

    RobG Guest


    Wouldn't normal menus and hrefs to the trick? If not, how about
    dynamic HTML (DHTML)? This is what they are intended to be used for.

    The ability to modify the right button menu is limited to a couple of
    browsers: not everyone has a right button and even if they do, they may
    not be able to use it (think of someone who is disabled).

    If your application is for a strictly controlled intranet where you can
    guarantee a suitable platform, you may be OK. But for the general web,
    you may be locking out 20% to 50% of potential visitors.
    RobG, Nov 25, 2004
    1. Advertisements

  3. Leon

    RobG Guest

    PS. As a hint to how dreadful Microsoft's on-line documentation is,
    here is a snippet of their effort to provide a demo of DHTML

    <SCRIPT LANGUAGE="JavaScript"><!--

    /* ----------------------------------------------------------------
    sniffing code to detect for IE4 on either Windows NT or 95
    ---------------------------------------------------------------- */

    var sAgent = navigator.userAgent
    var bIs95NT
    = sAgent.indexOf("Windows 95") > -1
    || sAgent.indexOf("Windows NT") > -1
    || sAgent.indexOf("Win32") > -1
    || sAgent.indexOf("Windows 98") > -1
    var bIsIE4
    = sAgent.indexOf("IE 4") > -1
    && sAgent.indexOf("b1") <= -1
    && sAgent.indexOf("p1") <= -1
    var bIsIE432 = bIs95NT && bIsIE4

    /* ----------------------------------------------------------------
    variable declarations for doMenu
    sOpenMenuID points to any open pop-up menus, is blank otherwise
    ---------------------------------------------------------------- */


    You may note that their own demo code excludes 95% of current web
    surfers! That is, anyone not using Win32/95/NT with IE 4.

    Good for a giggle but that's about it.
    RobG, Nov 25, 2004
  4. Leon

    TaeHo Yoo Guest

    Thanks for your reply.
    Yes, this is for intranet.
    Do you have any script for that?
    I am not very familier with DHTML.

    TaeHo Yoo, Nov 26, 2004
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.