Skip to content

Commit 8024953

Browse files
authored
Merge pull request #3508 from zx6733090/develop
fix the problem of loading local resources failed
2 parents 9eb6a3d + 6efd2a2 commit 8024953

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

CCBoot.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -797,7 +797,7 @@ cc.loader = (function () {
797797
xhr.setRequestHeader("Accept-Charset", "utf-8");
798798
xhr.onreadystatechange = function () {
799799
if (xhr.readyState === 4)
800-
xhr.status === 200 ? cb(null, xhr.responseText) : cb({status:xhr.status, errorMessage:errInfo}, null);
800+
(xhr.status === 200||xhr.status === 0) ? cb(null, xhr.responseText) : cb({status:xhr.status, errorMessage:errInfo}, null);
801801
};
802802
} else {
803803
if (xhr.overrideMimeType) xhr.overrideMimeType("text\/plain; charset=utf-8");
@@ -811,7 +811,7 @@ cc.loader = (function () {
811811
xhr.removeEventListener('timeout', timeoutCallback);
812812
}
813813
if (xhr.readyState === 4) {
814-
xhr.status === 200 ? cb(null, xhr.responseText) : cb({status:xhr.status, errorMessage:errInfo}, null);
814+
(xhr.status === 200||xhr.status === 0) ? cb(null, xhr.responseText) : cb({status:xhr.status, errorMessage:errInfo}, null);
815815
}
816816
};
817817
var errorCallback = function () {
@@ -876,7 +876,7 @@ cc.loader = (function () {
876876
window.msg = arrayBuffer;
877877
}
878878
if (xhr.readyState === 4) {
879-
xhr.status === 200 ? cb(null, xhr.response) : cb({status:xhr.status, errorMessage:errInfo}, null);
879+
(xhr.status === 200||xhr.status === 0) ? cb(null, xhr.response) : cb({status:xhr.status, errorMessage:errInfo}, null);
880880
}
881881
};
882882
var errorCallback = function(){

0 commit comments

Comments
 (0)