views:

68

answers:

2

Hi I my application i am having three links, on clicking the link i need to find which link has been clicked and need to pass some unique information to the next page.

Kindly help

+3  A: 

Like this <a href="/newpage?some_key=somevalue">link</a>

You'll need to query the parameters on the receiving page, though you could also use a target '#data' and query that.

This site has an example implementation of reading URL parameters

SpliFF
+2  A: 

It would be good if you could clarify this a bit. Because there are many ways if solving this without Javascript...

You can either add a paramater to the URL link that is clicked. For instance instead of:

<a href="about.php">About</a>

Use:

<a href="about.php?clicked=about">About</a>

Then simply use that value in using Javascript on the following page by using for instance this script: http://snipplr.com/view/799/get-url-variables/

If you are using a server-side scripting language like PHP you can pick up on what page refered to the page your on.

echo $_SERVER['HTTP_REFERER'] 

There are more examples, just comment on this if you want me to give you more.

WmasterJ
on the click i want to go to a servlet and in the servlet i want to get that information.
Hari
You can try to use `request.getHeader("Referer");` More info in link: http://bit.ly/c4Y2Pb
WmasterJ