Wednesday, August 14, 2013

How to get/read data from xml file using jquery?

Code: 

$.ajax({
type: "GET",
url: "book.xml",
dataType:"xml",
success: function(xml) {
$(xml).find('attributes').each(function(){
var bg=$(this).find('background').text();
});
}
});

Explanation: Using this you can get the datas from the xml file.

No comments: