jQuery ajax type GET url news xml dataType xml async false success fun

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
jQuery.ajax({ type: "GET", url: "news.xml", dataType: "xml", async: false, success: function(xml) {
var allNew = xml.getElementsByTagName("new");
number = allNew[i].getElementsByTagName("number")[0].childNodes[0].nodeValue;
title = allNew[i].getElementsByTagName("title")[0].childNodes[0].nodeValue;
date = allNew[i].getElementsByTagName("date")[0].childNodes[0].nodeValue;
preImg = allNew[i].getElementsByTagName("preImg")[0].childNodes[0].nodeValue;
preview = allNew[i].getElementsByTagName("preview")[0].childNodes[0].nodeValue;
}
});