I'm utilizing the openexchangerates api to retrieve exchange rates. However, I am encountering an issue with the line of code: var t = JSON.parse(json.rates);. When running this code, I receive an error message 'Uncaught SyntaxError: Unexpected token o'. Can anyone assist me in troubleshooting this problem?
$( document ).ready(function() {
$.ajax({
url: 'http://openexchangerates.org/api/latest.json?app_id=xxxxxxxxxxxxxxxxxxxxx',
dataType: 'jsonp',
success: function(json) {
var t = JSON.parse(json.rates);
console.log(t);
}
});
});