Current time: 02-26-2021, 08:54 AM Hello There, Guest! (LoginRegister)

Post Reply 
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Invalid JSON When Callback Specified
12-31-2011, 03:16 PM
Post: #1
Invalid JSON When Callback Specified

In October I wrote a script to retrieve results from runtest.php. I specified the format JSON and told it to use a callback URL, and it worked fine. I just tried it and no longer works, though I'm not sure when/where the change occurred.

Rather than returning an object in JSON, runtest.php now returns the object in JSON but as if passed into a function: callback(object).

This form of URL:

Returns this form of response:

It used to return just the object:

Is this new behavior expected? Thanks.
Find all posts by this user
Quote this message in a reply
01-03-2012, 01:47 AM
Post: #2
RE: Invalid JSON When Callback Specified
Argh, sorry. Most of the code suported JSON and JSONP where JSONP would be used if a callback parameter was specified. I was cleaning up the JSON support across the different API's and didn't catch the parameter collision.

Since "callback" is used pretty heavily for JSONP (and particularly for HAR's and the har viewer) would you mind using "pingback" instead of "callback" for the URL? I just pushed the code to production and it should resolve the issue.
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 

Forum Jump:

User(s) browsing this thread: 1 Guest(s)