PDA

View Full Version : Creating a List Menu in JavaScript



bigcougar
28 Oct 2010, 01:32 AM
I HAD THE ISSUE BELOW SORTED OUT. THANK YOU.



This may be easy for most of you, but I am stuck.

I am retrieving a field from a database, let's call it "Q".

The response texts is handled well. (I use the AJAX request method).

Now what I am trying to do is insert a link in a table cell where the records in the responde text are used as parameters for a JavaScript function.


This line does not work:

(host cell)= "<a href='javascript:GetFlyPic('"+q+"')'>"+q+"</a>";

The issue comes from the ' " + q + " ' that should go inside the function brackets.

As a separate problem I have those tags appended to the first element and are passed as an argument to the function - "<html><body></body></html>"

What is the proper syntax of the link and how can I avoid the tags appending to my argument.

Here is the visual form:
http://www.troutsalmonchar.com/Pages/FLY_MAIN_About.php
(select "Steelhead" and "dry" or "wet"; then check the results)