Side navigation
#4734 closed bug (duplicate)
Opened June 06, 2009 03:04AM UTC
Closed October 21, 2010 01:24AM UTC
Last modified October 21, 2010 01:24AM UTC
$.ajax Local Error Event Is Called Intermittently When Used With JSONP
Reported by: | tidalwav1 | Owned by: | |
---|---|---|---|
Priority: | minor | Milestone: | 1.4 |
Component: | ajax | Version: | 1.3.2 |
Keywords: | jsonp error ajaxerror getjson | Cc: | |
Blocked by: | Blocking: |
Description
I stumbled onto what could be a bug in JQuery's Ajax component.
I'm attempting to use $.ajax to work with JSONP (dataType : 'jsonp',) and it seems that this causes the local error event to not always get called when it should.
When the supplied URL results in a 404 page (with proper 404 HTTP headers,) execution of the script seems to simply halt instead of doing the desired behavior of calling the local error event. When the supplied URL is completely invalid (something such as "XYZ",) the local error event is called correctly.
Using getJSON() with the global ajaxError() event seems to exhibit the same behavior.
I asked about this problem in the JQuery IRC channel on Freenode, and an individual there thinks this behavior exists by design. If that's the case, maybe the JQuery Ajax API documentation should be modified to say that the Ajax error events can't be relied upon when using the JSONP dataType.
I've created a file that demonstrates the problem and have attached it to this ticket.
Can anyone shed any light on this?
This definitely looks like a problem worth reporting and I'll keep the ticket open, but if you'd like some discussion on it you're better off asking on the forum.