I\'m trying to extract the StateLongName and StateShortName values from the xml below.
I know there has to be a simple elegant way to do this with jQuery.
$.ajax({
type: "GET",
url: "labels.xml",
dataType: "xml",
success: function(xml) {
$(xml).find('label').each(function(){
var id_text = $(this).attr('id')
var name_text = $(this).find('name').text()
$('')
.html(name_text + ' (' + id_text + ')')
.appendTo('#update-target ol');
}); //close each(
}
}); //close $.ajax(
sample xml for this: