#1 Edited by dynamic_cast (5 posts) -

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.

#2 Edited by Chaser324 (6317 posts) -

What's the full query that you're trying to make?

Moderator Online
#3 Posted by dynamic_cast (5 posts) -

@chaser324: http://giantbomb.com/api/search/?api_key=key&query=uncharted&resources=game&format=json

#4 Posted by ll_Exile_ll (1428 posts) -

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.

#5 Edited by Chaser324 (6317 posts) -

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.

Moderator Online
#6 Posted by Zauzazu (71 posts) -
#7 Edited by dynamic_cast (5 posts) -

@chaser324: Thanks. It worked. I read that jQuery automatically appends a callback parameter so I was not bothering with it.

#8 Edited by Chaser324 (6317 posts) -
Moderator Online
#10 Posted by dynamic_cast (5 posts) -

@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.

#11 Posted by ch3burashka (5004 posts) -

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...

#12 Posted by Chaser324 (6317 posts) -

@dynamic_cast: The modified version totally works for me, but yeah, the first one isn't necessarily wrong. Use whatever works for you.

Moderator Online