471,598 Members | 1,171 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,598 software developers and data experts.

How to write this link in html?

17
Hi, I know this simple, but I tries several times and failed. In html there is a link to a site, but it only links to root dir, not next dir that I want.

In javascript
[code]
var pic="<a href=\"http://www.abc.com/\""+place[i]+"\"?cat=travel\" target=\"_blank\"><img align=\"left\" border=\"0\" src=\"/map/xml/logo.gif\" style=\"margin:0 5px 5px 0\" alt=\"Go to learn more\"></a>";
[code]

What I want is www.abc.com/sing?cat=travel
place[i] is an array variable, may refer to sing, dance, poem...

But what I got is always only www.abc.com

Why?

Thank you very much in advance.
Oct 3 '07 #1
2 2530
theS70RM
107 100+
var pic = "<a href=\"http://www.abc.com/"+place[i]+"?cat=travel\" target=\"_blank\"><img align=\"left\" border=\"0\" src=\"/map/xml/logo.gif\" style=\"margin:0 5px 5px 0\" alt=\"Go to learn more\"></a>";




u needed to lose the quotes around the place[i] variable.

if in doubt, use alert(pic) and see if the html makes sense.

Andy
Oct 3 '07 #2
1965
17
Thank you. Andy
Yes, it works.
Oct 3 '07 #3

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

4 posts views Thread by Charles Crume | last post: by
2 posts views Thread by PhoneLover | last post: by
1 post views Thread by Vincy | last post: by
7 posts views Thread by Remi Bastide | last post: by
1 post views Thread by Magix | last post: by
14 posts views Thread by Frank | last post: by
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.