jQuery.ajax({
async: false,
url: url,
dataType: dataType,
crossDomain: false
}).done(function(data) {
callback(null, data);
}).fail(function(jqXHR, textStatus, errorThrown) {
if (jqXHR.statusText === 'OK') {
console.log('Unable to load resource:', url, 'error:', errorThrown);
}
callback(errorThrown)
});
For the above ajax request call i am facing some errors
Error 1: Request header field X-Requested-With is not allowed by Access-Control-Allow-Headers in preflight
Error 2: DOMException: Failed to execute 'send' on 'XMLHttpRequest': Failed to load