Hi,
Thanks for the question!
If you take a look at the
getJSON function:
Code: Select all
function getJSON(url, success) {
HttpUtilities.ajax({
url: url,
success: success,
dataType: 'json',
headers: {
// Override the Content-Type to avoid preflight problems with CORS
// in the Highcharts demos
'Content-Type': 'text/plain'
}
});
}
you'll see that it's just sending a basic request to the server and hope to receive a JSON in return, and pass it to the
success callback function.
To be honest, I don't see anything that could be wrong with this function as it's pretty basic.
Are you sure that your server returns a proper JSON string? Are you sure that there's no problem with CORS or security headers?
If this function does not work for you, you can try out
axios or any other library that simplifies sending HTTP requests and create a fully custom request function with your setup (it should be only a few lines of code so not a lot of complexity).
Please let me know if you have any more questions.
Best regards!