, , CORS. , fetch(), . fetch() mode: 'cors', , CORS, .
mode: 'no-cors', ( ), , opaque.
api.flightstats.com , JSONP, CORS .
, , jQuery, , JSONP . . . URL- /json/ /jsonp/ dataType: "jsonp" jQuery. jQuery callback=xxxxx script ( JSONP).
var url =
'https://api.flightstats.com/flex/schedules/rest/v1/jsonp/from/SYD/to/MEL/departing/2016/3/28?appId=f4b1b6c9&appKey=59bd8f0274f2ae88aebd2c1db7794f7f';
$.ajax(url, {dataType: "jsonp"}).then(function(response) {
log(response);
}, function(err) {
log("$.ajax() error:")
log(err);
})
<script src="http://files.the-friend-family.com/log.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
Hide result