提交 e4feff11 编写于 作者: M Mr.doob

*Loader: Testing setResponseType( 'json' )

上级 bfd91b23
......@@ -19,9 +19,10 @@ Object.assign( AnimationLoader.prototype, {
var scope = this;
var loader = new FileLoader( scope.manager );
loader.load( url, function ( text ) {
loader.setResponseType( 'json' );
loader.load( url, function ( json ) {
onLoad( scope.parse( JSON.parse( text ) ) );
onLoad( scope.parse( json ) );
}, onProgress, onError );
......
......@@ -22,9 +22,10 @@ Object.assign( BufferGeometryLoader.prototype, {
var scope = this;
var loader = new FileLoader( scope.manager );
loader.load( url, function ( text ) {
loader.setResponseType( 'json' );
loader.load( url, function ( json ) {
onLoad( scope.parse( JSON.parse( text ) ) );
onLoad( scope.parse( json ) );
}, onProgress, onError );
......
......@@ -38,10 +38,10 @@ Object.assign( JSONLoader.prototype, {
var texturePath = this.texturePath && ( typeof this.texturePath === "string" ) ? this.texturePath : Loader.prototype.extractUrlBase( url );
var loader = new FileLoader( this.manager );
loader.setResponseType( 'json' );
loader.setWithCredentials( this.withCredentials );
loader.load( url, function ( text ) {
loader.load( url, function ( json ) {
var json = JSON.parse( text );
var metadata = json.metadata;
if ( metadata !== undefined ) {
......
......@@ -21,9 +21,10 @@ Object.assign( MaterialLoader.prototype, {
var scope = this;
var loader = new FileLoader( scope.manager );
loader.load( url, function ( text ) {
loader.setResponseType( 'json' );
loader.load( url, function ( json ) {
onLoad( scope.parse( JSON.parse( text ) ) );
onLoad( scope.parse( json ) );
}, onProgress, onError );
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册