$.ajax({
url: "http://192.168.153.131:8080/api/stats",
type: "GET",
dataType: 'JSONP',
jsonpCallback: 'jsonCallback'
});
function jsonCallback(response) {
console.log(JSON.parse(response));
}
I have a server that is serving JSON to this url and CORS is not able to be enabled so I need a way to get around that. I was trying to use JSONP but I cannot seem to get it to work.
this is the response that I am getting in the google chrome console:
{"time":1516239458,"global":{"workers":0,"hashrate":0},"algos":{"scrypt-n":{"workers":0,"hashrate":0,"hashrateString":"0.00 KH"}},"pools":{"garlicoin":{"name":"garlicoin","symbol":"GRLC","algorithm":"scrypt-n","poolStats":{"validShares":"198","validBlocks":"1","invalidShares":"7","totalPaid":0},"blocks":{"pending":1,"confirmed":0,"orphaned":0},"workers":{},"hashrate":0,"workerCount":0,"hashrateString":"0.00 KH"}}}
Which appears to be valid but it still throws an error.