Bug Tracker

Opened 12 years ago

Closed 12 years ago

Last modified 9 years ago

#8605 closed bug (patchwelcome)

Ajax GET of XML from local cache gives false error

Reported by: [email protected] Owned by: [email protected]
Priority: undecided Milestone: 1.next
Component: ajax Version: 1.5.1
Keywords: Cc:
Blocked by: Blocking:


Environment is Windows Safari 5.0.4 on Windows 7 (64bit O/S). This uses webkit browser engine (AppleWebKit/533.20.25).

I have an HTML5 application that uses the HTML5 local cache feature.

If I use Ajax GET to fetch XML files that has been cached, it returns false error (code: 0, message "error").

Problem seems to be due to raw GET returning a "status" of 0, which is not tested for within the jQuery code. My workaround (not a solution!) is to change line 6542 from

if ( status >= 200 && status < 300 || status === 304 ) {


if ( status >= 200 && status < 300 || status === 304 || status === 0) {

John Walton

Change History (3)

comment:1 Changed 12 years ago by addyosmani

Owner: set to [email protected]
Status: newpending

Thanks for submitting a ticket to the jQuery Bug Tracker. In order to assist you further, could you please also submit a reduced test case on http://jsFiddle.net that reproduces the issue you are experiencing?

Please also try testing using jQuery-GIT to see if the issue submitted persists.

comment:2 Changed 12 years ago by jaubourg

Component: unfiledajax
Resolution: patchwelcome
Status: pendingclosed


you're right when you state your workaround is not a solution and so far, we've found none :(

Files cached into the HTML5 local cache always issue a 0 status code just like a network error. While it is sometimes possible to somehow circumvent this behaviour when it comes to local file systems (since we have a specific protocol to deal with and can use this info to take specific actions), we found no general yet non-breaking solution for the HTML5 local cache.

If someone finds a solution that won't make it impossible to detect errors for spec-compliant requests (ie. returning a meaningful status code and 0 in case of a network error) then we'll be happy to review it.

All I can suggest is that you open a bug report against Safari/Webkit (if none exists already).

Last edited 12 years ago by jaubourg (previous) (diff)

comment:3 Changed 9 years ago by Dave Methvin

ajax: Fix #14207. file protocol returns status 0, see #8605.

Changeset: dce2edb3a615f9de158607c9f8be83809373940e

Note: See TracTickets for help on using tickets.