CORS error handling
by Sorfal
JavaScript
$(document).ready(function() {
var $xhr = $.ajax({
type: "GET",
url: "https://nano.aviasales.ru/places/top_ru.json",
crossDomain: true,
dataType: 'script'
});
$xhr.success(function() {
console.log("ERROR!");
});
$xhr.error(function() {
console.log("SUCCEED!");
});
});