我遇到了使用Jquery传递XML的问题。我在遍历jquery时得到空数组。请帮助我如何从XML数组获取数据。我在下面提到了我的代码。使用Jquery解析XML数组
XML
<?xml version="1.0" encoding="UTF-8"?>
<json>
<json>
<CustomerName>999GIZA MID INSURANCEAND SERVICES PVT LTD</CustomerName>
<mobiLastReceiptDate>null</mobiLastReceiptDate>
</json>
<json>
<CustomerName>A SHRIVENGATESH</CustomerName>
<mobiLastReceiptDate>null</mobiLastReceiptDate>
</json>
<json>
<CustomerName>A 1 PROCESS</CustomerName>
<mobiLastReceiptDate>null</mobiLastReceiptDate>
</json>
<json>
<CustomerName>A A A ENTERPRISES</CustomerName>
<mobiLastReceiptDate>null</mobiLastReceiptDate>
</json>
<json>
<CustomerName>A ALAGUSUNDARAM</CustomerName>
<mobiLastReceiptDate>null</mobiLastReceiptDate>
</json>
</json>
jQuery的
page_response=getResponse("yyyURL");
page_response.success(function(data){
console.log(data.results[0]);
console.log($(data).find("CustomerName"));
$(data).find("json").each(function(i, item) {
var heures = $(item).attr("CustomerName");
var nbr = $(item).attr("EMI");
<!--- Am getting array.. ineed to get name and EMI-->
console.log(heures);
});
});