Quantcast
Channel: Get All img tags out of xml file (jquery) - Stack Overflow
Browsing index pages (4 articles)

Get All img tags out of xml file (jquery)

I have the following xml file<gallery><album title="test" description="test" lgPath="/images/commphotos/"><img src="1130975173.jpg" /><img src="1475634985E.jpg" /><img...

View Article


Answer by Blazemonger for Get All img tags out of xml file (jquery)

Just treat the XML document like any other:$(xml).find('img');Update: This will give you a jQuery object containing all the tags as DOM elements. If you want, say, an array of the tags as strings, it...

View Article


Answer by Sinetheta for Get All img tags out of xml file (jquery)

$(xml).find('img').attr('src')

View Article

Answer by kapa for Get All img tags out of xml file (jquery)

With the .map() function, you can easily get all the src attributes of those imgs into a Javascript array. Of course you can use .each() also, but it is much more elegant this way.var srcArray =...

View Article
Browsing index pages (4 articles)


Latest Images