pls. help

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • ak47@LAN

    pls. help

    "<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: ak47hk@newsgrou p.com.hk


  • VK

    #2
    Re: pls. help

    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...


    Comment

    • Antonie C Malan Snr

      #3
      Re: pls. help

      ak47@LAN wrote:[color=blue]
      > "<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!!!
      >
      >[/color]
      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

      Comment

      Working...