function lookupICAO() {
var icao = $("#airporticao").val();
if (icao.length != 4) {
$("#statusbox").html("Please enter the full 4 letter ICAO");
return false;
}
$("#statusbox").html("Fetching airport data...");
$("#lookupicao").hide();
var url = "https://virtualairlines.eu/airports.php?icao=" + icao + "&callback=?";
console.log("URL: " + url);
$.ajax({
url: url,
dataType: "jsonp", // Specifies that the request is for JSONP
success: function(data) {
console.log("Data received: ", data);
if (!data.airports || data.airports.length === 0) {
$("#statusbox").html("Nothing found. Try entering the full 4 letter ICAO");
$("#lookupicao").show();
return;
}
$.each(data.airports, function(i, item) {
console.log("Processing item: ", item);
$("#airporticao").val(icao);
$("#airportname").val(item.name);
$("#airportcountry").val(item.countryName);
$("#airportlat").val(item.lat);
$("#airportlong").val(item.lng);
$("#fuelprice").val(item.jeta);
$("#statusbox").html("");
$("#lookupicao").show();
});
},
error: function(jqxhr, textStatus, error) {
var err = textStatus + ", " + error;
console.error("Request Failed: " + err);
$("#statusbox").html("Error fetching data. Please try again.");
$("#lookupicao").show();
}
});
return false;
}
Change your function to this, it's been tested and working on both Chrome and Firefox