JSON return with error: SyntaxError: missing; before statement

0

I'm having a problem with the JSON return, and I've researched and found no solution. I have the following requisition:

  var url = 'http://zcash.flypool.org/api/miner_new/t1UjazwJJnrUGoPh4GJYJ9FV6sYFzYg6H63?callback=?';

  $.getJSON(url, function(data){
    alert(data);
  });

And gives the following error:

SyntaxError: missing ; before statement[Learn More]  t1UjazwJJnrUGoPh4GJYJ9FV6sYFzYg6H63:1:10

Can anyone help me solve this problem, or give me a light on how to solve it?

Thank you!

    
asked by anonymous 14.06.2017 / 20:19

1 answer

1

The error is happening because you have not defined a function for callback. I'll give you an example of how you resolve this.

function teste(r){console.log(r);}
var url = 'http://zcash.flypool.org/api/miner_new/t1UjazwJJnrUGoPh4GJYJ9FV6sYFzYg6H63?callback=teste';

 $.getJSON(url, function(data){
   alert(data);
 });
    
14.06.2017 / 21:59