when I warn that it returns the string as follows:
data "<?xml version="1.0" encoding="utf-8" ?>
<xml xmlns="http://www.opengis.net/kml/2.2">
<Document>
<Name>John Smith</Name>
<Description>stackoverflow</Description>
<Total>50</Total>
</Document>
</xml>"
Update:
I tried to use this getJSON method and I get warnings but never execute insidefind('Document').each.....
$.getJSON(_url, function (data) {
alert(data);
$(data).find('Document').each(function () {
debugger
var name = $(this).find('Name');
var desc = $(this).find('Description').text();
var total = $(this).find('Total').text()
});
});
how to read the xml file in jquery, below is what returns me as a string, and I see that when I do a warning (data);
$.getJSON(url, {},
function (data) {
alert(data);
}
});
<?xml version="1.0" encoding="utf-8" ?>
- <xml xmlns="http://www.opengis.net/kml/2.2">
- <Document>
<Name>John Smith</Name>
<Description>stackoverflow</Description>
<Total>50</Total>
</Document>
</xml>
source
share