I'm trying to get data from a server with a jquery getJSON function. The server I'm trying to contact does not allow CORS so the connection needs to be whitelisted. My idea was to put this html and javascript file on a server and whitelist the server, but my colleauge says this will still not work because the javascript getJSON function is run in the browser. Which in his opinion would still generate a CORS error.
I'm totally new to javascript and server development so please enlighten me on this. How would I go about it?
I've already tried connecting through a proxy for the CORS connection.
$.getJSON(url, function(resp) {
i = resp.total;
});
I want to get the value "total" but I'm recieving a CORS error.