File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes HTML, CSS and JavaScript and the fly likes method on click in HREF Link Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "method on click in HREF Link" Watch "method on click in HREF Link" New topic
Author

method on click in HREF Link

vineet kumar chaudhry
Ranch Hand

Joined: Apr 02, 2011
Posts: 45
I have the page like
[code]
<a href ="contact.htm">Contact</a>
<a href ="admin.htm">Admin</a>
[code]
I ma considering contact as id for below example
Now I want : When contact button is clicked its " id " should be captured i.e. contact and a new page html(contact.htm in this case) should be created and the user should see contact.htm

Similarly I wanna do with admin.htm

Basically I need to create the page before displaying

Can anybody help me what would be the javascript used.I am using Apache Velocity for creating the html pages which are generated when the java code is run

Thanks
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
Reason why the serverside is not adding the ids? Seems like the logical place for it to be.



You just need to add an onclick handler to the links

onclick="appendId(this);"

Eric



 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: method on click in HREF Link
 
Similar Threads
Help with tabbed Panel
Facing problem when I am mixing struts and AJAX
a regular expression search and replace program
problem with the popup
html-only jsp page displaying source in safari browser on a mac