I have a problem when retrieving data with the format set to json. The debug console says I have a syntax error which is located in the response from GiantBomb.
Error with format=json
@chaser324: http://giantbomb.com/api/search/?api_key=key&query=uncharted&resources=game&format=json
I have a problem when retrieving data with the format set to json. The debug console says I have a syntax error which is located in the response from GiantBomb.
I'm sorry.
Looking at the other thread you created, it looks like you're trying to do an AJAX call, in which case you need to make sure you specify that you want a result in the JSONP format and that you specify a callback.
Here's an example I just threw together. Just plug in your API key and try it out in your console: https://gist.github.com/Chaser324/15546811139ed13956b0
Take note of the 'json_callback=callback' parameter which references the function 'callback' defined below.
@ll_exile_ll: Dangit, beat me to the joke.
@chaser324: Thanks. It worked. I read that jQuery automatically appends a callback parameter so I was not bothering with it.
@dynamic_cast: You're actually correct about that, and that's probably a better way approach it. I've corrected the gist to properly use the 'jsonp' and 'jsonpCallback' arguments of jQuery's ajax function (...my initial error was probably just due to lack of sleep).
@chaser324: I don't know if "error" is the correct word to use in relation to the first solution you gave because this updated one is no longer working for me. The complete function still executes to log "done" to the console but the callback isn't firing.
Hey guys, remember that Quantic Dream game with that one kid whose name sounds like that thing he said? Wouldn't that be funny?
Oh wait...
@dynamic_cast: The modified version totally works for me, but yeah, the first one isn't necessarily wrong. Use whatever works for you.
Please Log In to post.
Log in to comment