View Full Version : Alternate content = image PATH?

04-30-2004, 05: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!

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

Need it to point to:

04-30-2004, 06: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..


04-30-2004, 07: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">

="<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?

04-30-2004, 07: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.


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

04-30-2004, 08:07 PM
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.