瀏覽代碼

JSONLoader: Moved .withCredentials under .open. See #2927.

Mr.doob 12 年之前
父節點
當前提交
46d3c98478
共有 1 個文件被更改,包括 1 次插入2 次删除
  1. 1 2
      src/loaders/JSONLoader.js

+ 1 - 2
src/loaders/JSONLoader.js

@@ -32,8 +32,6 @@ THREE.JSONLoader.prototype.loadAjaxJSON = function ( context, url, callback, tex
 
 	var length = 0;
 
-	xhr.withCredentials = this.withCredentials;
-
 	xhr.onreadystatechange = function () {
 
 		if ( xhr.readyState === xhr.DONE ) {
@@ -86,6 +84,7 @@ THREE.JSONLoader.prototype.loadAjaxJSON = function ( context, url, callback, tex
 	};
 
 	xhr.open( "GET", url, true );
+	xhr.withCredentials = this.withCredentials;
 	xhr.send( null );
 
 };