$.ajax({
beforeSend: function(xhr) {
xhr.setRequestHeader(\'Authorization\', \"Basic YWRtaW46YWRtaW4=\");
},
url: \"https://test.com/incident.do
If you are using 1.5.2 (and maybe older versions), you can disable jsonp if you do not need it or want it.
So for all ajax calls add this somewhere on your page:
$.ajaxSetup({
jsonp: null,
jsonpCallback: null
});
Or for just one call, add this:
jsonp: null,
jsonpCallback: null,
So in your example:
$.ajax({
beforeSend: function(xhr) {
xhr.setRequestHeader('Authorization', "Basic YWRtaW46YWRtaW4=");
},
url: "https://test.com/incident.do?JSON&callback=?&sysparm_action=getRecords",
dataType: "json",
contentType: "application/json",
method: 'GET',
jsonp: null,
jsonpCallback: null,
success: function(a,b,c) {
alert(a);
}
});