pls. help

A

ak47@LAN

"<img src=/test/gif/image.gif border=0>Test"

I want to put the gif path to a variable, then gifPath="/test/gif/" , how
can I apply the gifPath into the above code to replace "/test/gif/"?

Thanks a lot!!!
 
V

VK

when rendering the page (first load) could be:
....
<script>
var gifPath='/test/gif/'
<script>
....
....html-html-blah
....
<script>
document.write('<img src='+gifPath+'image.gif border=0');
</script>
....further blah...
 
A

Antonie C Malan Snr

ak47@LAN said:
"<img src=/test/gif/image.gif border=0>Test"

I want to put the gif path to a variable, then gifPath="/test/gif/" , how
can I apply the gifPath into the above code to replace "/test/gif/"?

Thanks a lot!!!
Try var path = "/test/gif/";
Then for the image do
var img = "image.gif"

Then var myImage = new Image();
myImage.src = path + img;

Is this what you wanted?

Chris
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,900
Latest member
Nell636132

Latest Threads

Top