大家好,我有一个问题。在这里,我有一个代码,我用Ajax解析一个xml文件,但我有一个问题,我如何通过Title解析这个XML?我需要将所有值都放在数组中,之后进行循环或如何?
jQuery(document).ready(function ($) {
$.ajax({
url: xml_url,
type: "GET",
dataType: "xml",
cache: false,
success: function (msg) {
$(msg).find('m\\:properties').each(function (id, item) {
var eachsection = $("#div").appendTo("#newdiv");
var itemId = $(item).find('d\\:' + id).text();
var itemTitle = $(item).find('d\\:' + title).text();
var itemCategory = $(item).find('d\\:' + category).text();
var itemContent = $(item).find('d\\:' + content).text();
$(eachsection).each(function() {;
$(div).find('.q_weblinksprite_med').text(itemTitle);
$(div).find(".status").text(itemStatus);
$(div).find('.q_rt_rowcell-1-title').text(itemCategory);
$(div).find('.q_clipline').html(itemContent);
});
});
},
error: function (msg) {
console.log("Error");
}
});
});