Opened 10 years ago
Closed 8 years ago
#13806 closed feature (migrated)
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: |
Description
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.
Change History (6)
comment:1 Changed 10 years ago by
comment:2 Changed 10 years ago by
Cc: | jaubourg added |
---|
comment:3 Changed 10 years ago by
@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).
comment:4 Changed 10 years ago by
Component: | unfiled → ajax |
---|---|
Owner: | set to [email protected]… |
Priority: | undecided → low |
Status: | new → assigned |
Type: | bug → feature |
comment:6 Changed 8 years ago by
Resolution: | → migrated |
---|---|
Status: | assigned → closed |
Migrated to https://github.com/jquery/jquery/issues/1743
Are you still interested in providing a patch? How widespread is
.onerror
support in XHR?