You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Still poking around on this. Again, I am new to all of the API/JSON logic. But when I call the request with dataType : json I get Accept:application/json, text/javascript in the header.
However, I think I will need to use JSONP to make this work and I only get Accept: application/json
Could this be the root of the problem?
Whatsmore, I see the request returning a successful array in my network tabs but it is not showing up in the console.
Hey, thanks for putting this together. I am very new to api calls so forgive me.
I realized that I can't just make a simple $.getJSON call because of the same origin policy.
So I am trying to use JSONP to get around that. Here is my code:
$.ajax({
type: 'GET',
url: 'http://www.medalbot.com/api/v1/medals/united-states',
dataType: 'jsonp',
success: function() { console.log('Success!'); },
error: function() { console.log('Uh Oh!'); },
jsonp: 'jsonp'
});
However, I keep getting an error
Uncaught SyntaxError: Unexpected token :
any thoughts on how to get around this?The text was updated successfully, but these errors were encountered: