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

L

Leon

Is it possible?
Say

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>



<script>
function RightClicked(supplierID)
{
// don't know I am making this up here
if (viewDetailsClicked)
ShowDetails(supplierID);
else if (viewProducts)
ShowProducts(supplierID)
etc
..
}
</script>

Can it be done, does anyone have the script?

Thanks a lot
 
R

RobG

Leon said:
Is it possible?
Say

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.
[...]

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.
 
R

RobG

Leon said:
Is it possible?
Say

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>

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
menus:

<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
---------------------------------------------------------------- */


<URL:http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dndhtml/html/popupmenu.asp>

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.
 
T

TaeHo Yoo

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

Thanks
 

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. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,733
Messages
2,569,440
Members
44,830
Latest member
ZADIva7383

Latest Threads

Top