I'm trying to get data from a URL
that returns JSON
to use on my page. Apparently I'm getting the data, but for some reason I get the following error in the browser console:
"Uncaught SyntaxError: Unexpected token:".
For the moment, the only thing I'm doing is fetching the data and playing on log
of the console with jquery
. the code I'm using is as follows:
function logResults(json){
console.log(json);
}
$.ajax({
url: "https://blockchain.info/pt/ticker",
dataType: "jsonp",
jsonpCallback: "logResults"
});