I've been thinking about an implementation of error detection. You can check if the script tag is loaded, this is cross-browser, so... If the script has loaded (independent of the http status code) and the callback has not executed, lets say 200 ms after, we can say that we got some kind of error.
Still i can't tell you too much about what error it gave... but something didn't go ok and your data was not retrieved. Feedbacks? -- Fábio Miranda Costa frontend@portalpadroes Globo.com *github:* fabiomcosta *twitter:* @fabiomiranda *ramal:* 6476 On Wed, Jul 6, 2011 at 9:03 PM, Aaron Newton <[email protected]> wrote: > JSONP can't catch 400 errors because it's a callback system waiting for the > script to load. If the script fails, the callback is not invoked and so it > has no way of knowing that the script failed. The best it can do is be given > a timeout. If the request takes too long, or the script tag that is injected > fails to load, the timeout fires and you know it didn't load. > > > On Wed, Jul 6, 2011 at 2:22 PM, Rolf -nl <[email protected]> wrote: > >> Working with some api that can return a bad request code 400 error >> with the error message as a response in json. Is there a way I can use >> it? Because the response contains useful information about wrongly >> used params? There's a failure event, but that works with the timeout >> and I that's not really usable or the same. >> > >
