提交 5358705b 编写于 作者: M Michael Decker

Added XHR 'withCredentials' option to JSONLoader to send cookies with...

Added XHR 'withCredentials' option to JSONLoader to send cookies with cross-site requests (e.g. json model access token)
上级 7474cd3e
...@@ -7,6 +7,8 @@ THREE.JSONLoader = function ( showStatus ) { ...@@ -7,6 +7,8 @@ THREE.JSONLoader = function ( showStatus ) {
THREE.Loader.call( this, showStatus ); THREE.Loader.call( this, showStatus );
this.withCredentials = false;
}; };
THREE.JSONLoader.prototype = Object.create( THREE.Loader.prototype ); THREE.JSONLoader.prototype = Object.create( THREE.Loader.prototype );
...@@ -28,6 +30,8 @@ THREE.JSONLoader.prototype.loadAjaxJSON = function ( context, url, callback, tex ...@@ -28,6 +30,8 @@ THREE.JSONLoader.prototype.loadAjaxJSON = function ( context, url, callback, tex
var length = 0; var length = 0;
xhr.withCredentials = this.withCredentials;
xhr.onreadystatechange = function () { xhr.onreadystatechange = function () {
if ( xhr.readyState === xhr.DONE ) { if ( xhr.readyState === xhr.DONE ) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册