AirlineFlightSchedules query doesn't work


#1

Hi,

I modified the JQuery+Ajax sample code to get AirlineFlightSchedules data, but the code didn’t work. Would someone check it and let me know what’s wrong? Thanks a lot!

// When the button is clicked, fetch the details about the entered flight ident.
(document).ready(function() { (’#go_button’).click(function() {
.ajax({ type: 'GET', url: fxml_url + 'AirlineFlightSchedules', data: { 'startDate': 1357830291, 'endDate': 1357916691, 'offset': 0, 'origin': 'KJFK', 'howMany': 3}, success : function(result) { // display some textual details about the flight. var schedule = result.AirlineFlightSchedulesResult.data; var faFlightID; var table = new google.visualization.DataTable(); table.addColumn('string', 'Orig'); table.addColumn('number', 'DepartureTime'); table.addColumn('string', 'Actual Ident'); table.addColumn('string', 'Destination'); for (rowid = 0; rowid < schedule.length; rowid++) { table.setCell(rowid, 0, schedule[rowid].orig); table.setCell(rowid, 1, schedule[rowid].departuretime); table.setCell(rowid, 2, schedule[rowid].actual_ident); table.setCell(rowid, 3, schedule[rowid].destination); } //(’#results’).html('Flight ’ + schedule.ident + ’ from ’ + schedule.origin + ’ to ’ + flight.destination);
},
error: function(data, text) { alert('Failed to fetch AirlineSchedules: ’ + data); },
dataType: ‘jsonp’,
jsonp: ‘jsonp_callback’,
xhrFields: { withCredentials: true }
});
});
});


#2

You will need to enable the Javascript debugger functionality within your browser to determine where your syntax error is. The FlightXML endpoint is working as expected and returning successful data:
flightxml.flightaware.com/json/F … &howMany=3