I have this method:
var chineseCurrency = getChinese();
function getChinese(){
return $.ajax({
context: this,
type: 'GET',
dataType: 'json',
url: "https://www.cryptonator.com/api/ticker/usd-cny"
});
}
That is what printed when console.log(chineseCurrency);
:
I am not able to make chineseCurrency
equal to "price"
, so it would be "6.80071377"
. How can I do that? Tried chineseCurrency.responseText
, nope, chineseCurrency['responseText']
, nope. Tried to JSON.parse(chineseCurrency)
, nope. Nothing works!
Sorry if repeated, couldn't find any answer at Stackoverflow.