By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,442 Members | 1,316 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,442 IT Pros & Developers. It's quick & easy.

pls. help

P: n/a
"<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!!!
--
Email: ak****@newsgroup.com.hk
Jul 23 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
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...
Jul 23 '05 #2

P: n/a
ak47@LAN wrote:
"<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

Jul 23 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.