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

Inserting parameters into hyperlink dynamically

 
Rajesh Khan
Ranch Hand
Posts: 230
  • Mark post as helpful
  • send pies
  • 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.
 
Stefan Evans
Bartender
Posts: 1784
10
  • Likes 1
  • Mark post as helpful
  • send pies
  • 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:




 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic