Parsing the first image src of a list

Posted by zurna on Stack Overflow See other posts from Stack Overflow or by zurna
Published on 2010-03-24T01:50:25Z Indexed on 2010/03/24 1:53 UTC
Read the original article Hit count: 355

Filed under:

I need to parse a value from an xml and place it to image's src field. I tried parsing it as $(".photoBox img").append(ImageSmURL); and I got

<img src="" alt="">/FLPM/media/images/0E7Q9Z0C_sm.jpg/FLPM/media/images/2A9L1V2X_sm.jpg</img>

how do I do it so the result will be as...

<img src="/FLPM/media/images/0E7Q9Z0C_sm.jpg" alt="" />

My xml

<Images>
<ImageID id="63">
<ImageSmURL>/FLPM/media/images/5V2G4Q5S_sm.jpg</ImageSmURL>
<ImageLgURL>/FLPM/media/images/5V2G4Q5S.jpg</ImageLgURL>
</ImageID>
<ImageID id="64">
<ImageSmURL>/FLPM/media/images/5Y2K4T5V_sm.jpg</ImageSmURL>
<ImageLgURL>/FLPM/media/images/5Y2K4T5V.jpg</ImageLgURL>
</ImageID>
</Images>

© Stack Overflow or respective owner

Related posts about jQuery