Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

method on click in HREF Link

 
vineet kumar chaudhry
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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



 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic