Using JS to generate HTML

wxdqz

New Member
..卆nd he trepidatiously approaches the microphone?.
.....testing...one...two...hello?...testing.....

This is just a test for something I want to try later, but I can抰 figure out why it isn抰 working. All the HTML tags I use work fine with this 搒ystem? but not the images. Here抯 a sample.

var lnk = "www.tld.com"
var img = "tld.gif"
document.write("<a href=http://www.webdeveloper.com/forum/archive/index.php/& q u o t ;" + lnk + "& q u o t ;><img src=& q u o t ;" + img + "& q u o t ;></a>")

This produces a blue border around a working link, but no image (just the little red 搙?. The image does exist, and everything is in the same directory. As a test, I wrote the following in straight HTML

<a href="www.tld.com"><img src="tld.gif"></a >

and it works fine.

What am I missing???

---
Note: In the above code, I've spaced out "& q u o t ;", so the forum won't display it as a " sign. In my page, it's done correctly.
 
Back
Top