pls. help

Discussion in 'Javascript' started by ak47@LAN, Sep 15, 2004.

  1. ak47@LAN

    ak47@LAN Guest

    "<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:
    ak47@LAN, Sep 15, 2004
    #1
    1. Advertising

  2. ak47@LAN

    VK Guest

    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...
    VK, Sep 15, 2004
    #2
    1. Advertising

  3. 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
    Antonie C Malan Snr, Sep 19, 2004
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Alistair Lamb

    CLOCK__SIGNAL constraint! pls help

    Alistair Lamb, Mar 24, 2005, in forum: VHDL
    Replies:
    1
    Views:
    1,538
    Tim Good
    Mar 24, 2005
  2. James Bond
    Replies:
    0
    Views:
    516
    James Bond
    Aug 3, 2004
  3. Rahul S.
    Replies:
    3
    Views:
    596
    Flash Gordon
    Nov 1, 2004
  4. Replies:
    1
    Views:
    274
    RedGrittyBrick
    Jan 2, 2008
  5. Emiliano
    Replies:
    2
    Views:
    314
    Rajesh.V
    Oct 16, 2003
Loading...

Share This Page