Browse Source

Reverted adding of property, rewritten to accept http status 0.

leitzler 9 years ago
parent
commit
7a82ed7237
1 changed files with 12 additions and 9 deletions
  1. 12 9
      src/loaders/XHRLoader.js

+ 12 - 9
src/loaders/XHRLoader.js

@@ -12,8 +12,6 @@ THREE.XHRLoader.prototype = {
 
 	constructor: THREE.XHRLoader,
 
-	strict: true,
-
 	load: function ( url, onLoad, onProgress, onError ) {
 
 		if ( this.path !== undefined ) url = this.path + url;
@@ -48,7 +46,18 @@ THREE.XHRLoader.prototype = {
 
 			THREE.Cache.add( url, response );
 
-			if ( ( this.status === 200 && this.readyState === 4 ) && scope.strict ) {
+			if ( this.status === 200 ) {
+
+				if ( onLoad ) onLoad( response );
+
+				scope.manager.itemEnd( url );
+
+			} else if ( this.status === 0 ) {
+
+				// Some browsers return HTTP Status 0 when using non-http protocol
+				// e.g. 'file://' or 'data://'. Handle as success.
+
+				console.warn( 'THREE.XHRLoader: HTTP Status 0 received.' );
 
 				if ( onLoad ) onLoad( response );
 
@@ -111,10 +120,4 @@ THREE.XHRLoader.prototype = {
 
 	}
 
-	setStrict: function ( value ) {
-
-		this.strict = value;
-
-	}
-
 };