I get an xml response from a jquery ajax request and I want to extract name and price for each item. I am stuck on the best way to handle this. From readings, it seems that rendering XML as a javascript object is best bet, but I am having trouble finding syntax to accomplish this and iterate through ...
$.ajax({
type: "POST",
url: "myPgm.php",
success: function(xml) {
var xmlDoc = $.parseXML(xml);
// now I want to iterate through the xml payload
// ....
}
})
xml look like this:
<items>
<item>
<name>item1</name>
<price>888</price>
</item>
<item>
<name>item2</name>
<price>999</price>
</item>
<items>