• 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

Inserting parameters into hyperlink dynamically

 
Ranch Hand
Posts: 230
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi i wanted to know if there was a way to insert content into a hyperlink dynamically. I mean i have something like this in table cell.

but Flink() is a javascript function which has a variable and a value which needs to be appended to the link so the link should like like this in the end

Is there any way in which i could make java script append that value ?? The only way i thing that is possible is to assign it a id. Traverse through the dom and then change the inner text.If i do that I still think it wont work since the link has already been clicked.
 
Bartender
Posts: 1845
10
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If the parameters to pass are well defined, one easy approach is to define a form with the parameters you want, then populate the input fields and submit the form via javascript.
Another would be to build up a url in a javascript string (don't forget to escape the necessary values), and then set it via window.location.href
All of that is javascript rather than JSP.

something like this:




 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic