Reputation: 131
I am using Apache cordova api for developing mobile application. I want to load the xml file and show the contents of xml file in a page of mobile app. Anyone please help me?
Upvotes: 0
Views: 63
Reputation: 4108
Try like this.
$.ajax({
type: "GET",
url: "../your xml url here/",
dataType: "xml",
success: function (xml){
$(xml).find('a').each(function(){
$.each(this.attributes, function(b, attr){
var name = attr.name;
var value = attr.value;
// do your operation here.
});
});
},
error: function(model, xhr, options) {
alert("error");
}
});
Upvotes: 1