I have this api
It returns a response in an xml format. This is a sample response.
<flightStatus>
<flightId>305133622</flightId>
<carrierFsCode>BA</carrierFsCode>
<flightNumber>1382</flightNumber>
<departureAirportFsCode>LHR</departureAirportFsCode>
<arrivalAirportFsCode>MAN</arrivalAirportFsCode>
<departureDate>
<dateLocal>2013-08-06T06:30:00.000</dateLocal>
<dateUtc>2013-08-06T05:30:00.000Z</dateUtc>
</departureDate>
I want to display the flight number and arrival time in html. How to go about that?
The code snippet is from the response; its not from an xml file that i have.
This is what i have tried.
<script>
function getResponse()
{
$.ajax({
type: 'POST',
url: 'https://api.flightstats.com/flex/flightstatus/rest/v2/xml/route/status/LHR/MAN/arr/2013/08/06?appId=ID&appKey=KEY&hourOfDay=0&numHours=24&utc=false&maxFlights=5',
data: {},
dataType: 'xml',
success: function(data)
{ $("display").html(data); },
error: function() { alert('something bad happened'); }
});
}
</script>