I am trying to write some simple Javascript to load a JSON payload from a URL.
I know I have CORS issues, and for the moment I'm fine with that. I can disable chrome's check.
The problem I have is that I get back a 200 OK response, but also an error and I don't understand why.
var urlAddress = "https://light-ratio-149809.appspot.com/ESI-OrgUnitService?jsoncallback=?";
$.getJSON(urlAddress, {
format: "json"
})
.always(function( jqXHR, textStatus, errorThrown ) {
console.log("reponse textStatus["+textStatus+"] errorThrown["+errorThrown+"] [" + jqXHR.responseText + "]");
})
.done(function(data) {
console.log("success");
});
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
Can someone please tell me where I'm going wrong?
If I use this JSON payload, it works.
The error looks to be a parse error.
reponse textStatus[parsererror] errorThrown[Error: jQuery331004379421802427674_1551456238952 was not called] [undefined]