id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc	blocking	blockedby
10552	Ajax response status 0	jonatan.wallgren@…	jonatan.wallgren@openbet.com	"Using jQuery.load can fail under some use cases even if the returned data is correct.

Consider following use case:

A webapp is served from a web server using ajax requests to fetch additional web pages using jquery load. All is fine.

Said webapp gets packaged with phonegap, now the resources will be fetched from the local file system on the device. On IOS, and possibly on other devices as well, the returned status code from the jQuery.load request will be zero even though the data in jqXHR.responseText will be returned correctly.

This documentation from Mozilla 

https://developer.mozilla.org/En/Using_XMLHttpRequest#Example.3a.c2.a0Non-HTTP_synchronous_request

states that XMLHttpRequest states ""Despite its name, XMLHttpRequest can be used for non-HTTP requests."" which I would guess a read from the local file system would be.

Also from the same document:

""The key thing to note here is that the result status is being compared to 0 for success instead of 200.  This is because the file and ftp schemes do not use HTTP result codes.""

Currently how you guys determine if the response is an error seems to be in this line of code:

https://github.com/jquery/jquery/blob/master/src/ajax.js#L520

""if ( status >= 200 && status < 300 || status === 304 )""

Adding a passing condition for zero like this:
""if ( status >= 200 && status < 300 || status === 304 || status === 0)""

solves my immediate problem, I get my ajax request data back correctly. What do you guys think of adding this passing condition to the jQuery source? If this solution seems to be to fragile it could maybe be an idea introduce some ways of suppressing error code 0?"	bug	closed	undecided	None	unfiled		invalid				
