• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

method on click in HREF Link

 
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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



 
Yeast devil! Back to the oven that baked you! And take this tiny ad too:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic