See img with the link made in JavaScript ...

Discussion in 'JavaScript' started by JK Net, Feb 1, 2008.

  1. #1
    Hello,

    How can I create a link to an image with javascript?


    I wanted to make something like:

    <img src="java script:xxx('$dtl_imagepath'$arr_picSrc)">


    How can I do?


    Thanks
     
    JK Net, Feb 1, 2008 IP
  2. nelse

    nelse Peon

    Messages:
    87
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    You have to generate all <img> tag in javascript.
     
    nelse, Feb 1, 2008 IP
  3. JK Net

    JK Net Peon

    Messages:
    80
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3

    Why? :confused:
     
    JK Net, Feb 4, 2008 IP
  4. locdev

    locdev Active Member

    Messages:
    171
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    58
    #4
    I think you can try this way:
    
    <img src="t.gif" id="img1" />
    <script>img1.src=xxx('$dtl_imagepath'$arr_picSrc);</script>
    
    Code (markup):
    t.gif is 1x1px point image
     
    locdev, Feb 4, 2008 IP