mirror of
https://github.com/photonstorm/phaser
synced 2024-12-17 16:43:30 +00:00
Allow XHR status 0 as success too
Normally only status 200 would be accepted as success, but 0 is returned when a file is loaded from the local filesystem (file://). This happens for example when opening the index.html of a (Phaser) game in a browser directly, or, as it turns out, when using Cordova on iOS. This fixes #3464
This commit is contained in:
parent
4c25d12b44
commit
44f9b10e8c
1 changed files with 1 additions and 1 deletions
|
@ -315,7 +315,7 @@ var File = new Class({
|
|||
*/
|
||||
onLoad: function (xhr, event)
|
||||
{
|
||||
var success = !(event.target && event.target.status !== 200);
|
||||
var success = !(event.target && (event.target.status !== 200 && event.target.status !== 0));
|
||||
|
||||
// Handle HTTP status codes of 4xx and 5xx as errors, even if xhr.onerror was not called.
|
||||
if (xhr.readyState === 4 && xhr.status >= 400 && xhr.status <= 599)
|
||||
|
|
Loading…
Reference in a new issue