Просмотр исходного кода

Added XHR 'withCredentials' option to JSONLoader to send cookies with cross-site requests (e.g. json model access token)

Michael Decker 12 лет назад
Родитель
Сommit
5358705bc3
1 измененных файлов с 4 добавлено и 0 удалено
  1. 4 0
      src/loaders/JSONLoader.js

+ 4 - 0
src/loaders/JSONLoader.js

@@ -7,6 +7,8 @@ THREE.JSONLoader = function ( showStatus ) {
 
 	THREE.Loader.call( this, showStatus );
 
+	this.withCredentials = false;
+
 };
 
 THREE.JSONLoader.prototype = Object.create( THREE.Loader.prototype );
@@ -28,6 +30,8 @@ THREE.JSONLoader.prototype.loadAjaxJSON = function ( context, url, callback, tex
 
 	var length = 0;
 
+	xhr.withCredentials = this.withCredentials;
+
 	xhr.onreadystatechange = function () {
 
 		if ( xhr.readyState === xhr.DONE ) {