Parsing the first image src of a list
- by zurna
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>