0
I have a problem with the JSON return, and I have already researched and I could not solve. I have the following requisition:
var url = 'http://zcash.flypool.org/api/miner_new/t1UjazwJJnrUGoPh4GJYJ9FV6sYFzYg6H63?callback=?';
$.getJSON(url, function(data){
alert(data);
});
And makes the following mistake:
SyntaxError: missing ; before statement[Learn More] t1UjazwJJnrUGoPh4GJYJ9FV6sYFzYg6H63:1:10
Can someone help me solve this problem, or give me a light on how to solve?
Thank you!
The error occurs in these lines of code same?
– Woss
In Firefox console, return in JSON.
SyntaxError: missing ; before statement[Learn More] t1UjazwJJnrUGoPh4GJYJ9FV6sYFzYg6H63:1:10
– Guilherme Lirio
Try to get the
?callback=?
end of url to see what happens...– JuniorNunes
Makes another mistake:
Requisição cross-origin bloqueada: A política de mesma origem (Same Origin Policy) impede a leitura do recurso remoto em http://zcash.flypool.org/api/miner_new/t1UjazwJJnrUGoPh4GJYJ9FV6sYFzYg6H63. (Motivo: o cabeçalho CORS 'Access-Control-Allow-Origin' não está presente).
– Guilherme Lirio
This already answers. You are not allowed to get the data from another domain. Read this and this for more details.
– Woss
Um, thank you. But there would be some way to recover the data from this link:
http://zcash.flypool.org/api/miner_new/t1UjazwJJnrUGoPh4GJYJ9FV6sYFzYg6H63
?– Guilherme Lirio
I tried to read in python:
HTTP Error 403: Forbidden
, that is, blocked public access, although it is possible to read via Rowse (there just use the 'creativity') :-)– Sidon
I don’t understand this 'creativity' kkkkk But there is no way: save to localStorage, and filter later?
– Guilherme Lirio
Dude, I was able to get the data using the
file_get_contents
PHP, you can make an ajax for a local server and this server make the request and then return to javascript... is a way...– JuniorNunes
@Juniornunes thanks for the tip! I managed to solve so =)
– Guilherme Lirio
@Guilhermelirio, creates a short answer of how you managed to solve and marks as a solution to help the next people who have the same question!! thanks!
– JuniorNunes