Reputation: 17701
Can anyone recommend the best way to do the following?
I need a loop that will loop through the first two xml items and do something with the contents, then a second loop that will loop through items 3 onwards and do something different? How can I specify this?
Thanks for your help
Paul
Upvotes: 0
Views: 1652
Reputation: 1233
Just loop through the items as you would normall (using $.parseXML()
and $.each()
), but check for the index of the item you're looking at and perform the different actions there.
For example: http://jsfiddle.net/lukemartin/RsXw9/
http://api.jquery.com/jQuery.parseXML/
Upvotes: 1