...

View Full Version : Alternate content = image PATH?



joyjam
04-30-2004, 06:38 PM
This is the code I have. It works great.
I want to add a directory path to it, but don't know how. I'm not even sure this is a Javascript question, or maybe ASP.
I'd appreciate any help I can get!

Have:
var alternateContent ="<img src=\"golf.gif\" />";

Need it to point to:
mPromo/05-2004/golf.gif

sad69
04-30-2004, 07:23 PM
Is that a relative or absolute location? Like from the directory your code is in, is there a mPromo directory there or is mPromo in the root or what? you may need to use ./mPromo or ../../mPromo or something....

But yea, you can just replace golf.gif with the location of the other golf.gif

Probably doesn't help much, but we need that info from you..

Sadiq.

joyjam
04-30-2004, 08:15 PM
Thank you for your reply, Sadiq.
It doesn't seem that simple.

I already used the ../ for the directory path before, but it seems to be a problem with the code.
Normally, in HTML the link would look like this:
<img src="./mPromo/05-2004/golf.gif">

but,
="<img src=\"./mPromo/o5-2004/golf.gif\" />";
doesn't work.
I believe it's because of the way it has to write the script.

Example : " is written as "\
and > is written as />

I don't know how to write / for the backslash in the directory path.
I think this is my problem. I don't even know if it's ASP or what.
Any clues?

sad69
04-30-2004, 08:35 PM
Ok, you don't have to use the dbl-quotes. Try incorporating single-quotes:


var alternateContent = "<img src='./mPromo/05-2004/golf.gif'>";


Let me know how that works out for you.

Sadiq.

joyjam
04-30-2004, 08:47 PM
I'll try it. Thank you very much for your help.

joyjam
04-30-2004, 09:07 PM
Sadiq-
Actually, upon further inspection, it wasn't the code after all, it had to do with another piece of the code and alternate browser code. I was changing the wrong snippet.
Thanks again for your help. The single quotes work just fine.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum