Skip to main content

Bug Tracker

Side navigation

#13806 closed feature (migrated)

Opened April 21, 2013 02:47PM UTC

Closed October 21, 2014 12:14AM UTC

JSONP error handler for cross origin requests is triggered only after timeout

Reported by: Owned by:
Priority: low Milestone: None
Component: ajax Version: 1.9.1
Keywords: Cc: jaubourg
Blocked by: Blocking:

The JSONP error handler is triggered for HTTP errors (e.g. 404) for same origin requests immediately, but for cross origin requests only after the timeout occurred. This can be easily fixed with adding script.onerror (see Zepto.js).

Tested browsers:

Affected: Chrome 26, Firefox 20, Safari 6, Opera 12.14

Not affected: IE 9

I will provide a patch later.

Attachments (0)
Change History (6)

Changed April 29, 2013 03:15PM UTC by dmethvin comment:1

Are you still interested in providing a patch? How widespread is .onerror support in XHR?

Changed April 29, 2013 03:15PM UTC by dmethvin comment:2

cc: → jaubourg

Changed April 29, 2013 06:43PM UTC by comment:3

@dmethvin, yes, but I am quite busy at the moment. I think script.onerror together with script.onreadystatechange covers the most browsers, but I am not sure about Opera. I found out that it is already fixed in jQuery 2. The reason why it works for same origin requests is that it uses XMLHttpRequest internally (altough the format is JSONP).

Changed May 02, 2013 08:33PM UTC by timmywil comment:4

component: unfiledajax
owner: →
priority: undecidedlow
status: newassigned
type: bugfeature

Changed July 29, 2013 04:54PM UTC by comment:5

Changed October 21, 2014 12:14AM UTC by m_gol comment:6

resolution: → migrated
status: assignedclosed