Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6
  1. #1
    New to the CF scene
    Join Date
    Jun 2002
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Alternate content = image PATH?

    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
    by the time I learn it, it's obsolete!

  • #2
    Senior Coder
    Join Date
    Feb 2004
    Posts
    1,206
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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.

  • #3
    New to the CF scene
    Join Date
    Jun 2002
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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?
    by the time I learn it, it's obsolete!

  • #4
    Senior Coder
    Join Date
    Feb 2004
    Posts
    1,206
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Ok, you don't have to use the dbl-quotes. Try incorporating single-quotes:
    Code:
    var alternateContent = "<img src='./mPromo/05-2004/golf.gif'>";
    Let me know how that works out for you.

    Sadiq.

  • #5
    New to the CF scene
    Join Date
    Jun 2002
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I'll try it. Thank you very much for your help.
    by the time I learn it, it's obsolete!

  • #6
    New to the CF scene
    Join Date
    Jun 2002
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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.
    by the time I learn it, it's obsolete!


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •