I need to get data from an API which returns xml format. here's the api url: http://api.tubeupdates.com/?method=get.status&lines=all&format=xml
here's my jquery code:
$(document).ready(function(){
$.get('http://api.tubeupdates.com/?method=get.status&lines=all&format=xml', function(d){
$(d).find('line').each(function(){
var $line = $(this).find('name').text()
var $mex = $(this).find('message').text()
$('#status').append($line+'<br>'+$mex+'<br><br>');
});
});
});
The div #status returns empty. My jquery code seems fine because with a physical xml file it works. What am I doing wrong?
Thanks in advance,
Mauro