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

Checking whether .overrideMimeType is available before calling it (and hopefully make IE9 happy)

上级 2bc1d141
......@@ -57,13 +57,7 @@ THREE.ColladaLoader = function () {
var req = new XMLHttpRequest();
if( req.overrideMimeType ) {
// need this? yes... if extension is other then *.xml :-S
req.overrideMimeType( "text/xml" );
}
if ( req.overrideMimeType ) req.overrideMimeType( "text/xml" );
req.onreadystatechange = function() {
......
......@@ -90,7 +90,7 @@ THREE.JSONLoader.prototype.loadAjaxJSON = function( context, url, callback, text
};
xhr.open( "GET", url, true );
xhr.overrideMimeType( "text/plain; charset=x-user-defined" );
if ( xhr.overrideMimeType ) xhr.overrideMimeType( "text/plain; charset=x-user-defined" );
xhr.setRequestHeader( "Content-Type", "text/plain" );
xhr.send( null );
......
......@@ -58,7 +58,7 @@ THREE.SceneLoader.prototype.load = function( url, callbackFinished ) {
};
xhr.open( "GET", url, true );
xhr.overrideMimeType( "text/plain; charset=x-user-defined" );
if ( xhr.overrideMimeType ) xhr.overrideMimeType( "text/plain; charset=x-user-defined" );
xhr.setRequestHeader( "Content-Type", "text/plain" );
xhr.send( null );
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册