提交 6dddcfa0 编写于 作者: P Pontus

Added property ignoreHTTPStatus. When set, the 'load' event handler will not...

Added property ignoreHTTPStatus. When set, the 'load' event handler will not check HTTP Status or readyState. Should only be used when XHRLoader fetch data from a non-http source (e.g. local file system, file://).
上级 39fb2745
......@@ -12,6 +12,8 @@ THREE.XHRLoader.prototype = {
constructor: THREE.XHRLoader,
ignoreHTTPStatus: false,
load: function ( url, onLoad, onProgress, onError ) {
if ( this.path !== undefined ) url = this.path + url;
......@@ -46,7 +48,7 @@ THREE.XHRLoader.prototype = {
THREE.Cache.add( url, response );
if ( this.status === 200 && this.readyState === 4 ) {
if ( ( this.status === 200 && this.readyState === 4 ) || scope.ignoreHTTPStatus ) {
if ( onLoad ) onLoad( response );
......@@ -109,4 +111,10 @@ THREE.XHRLoader.prototype = {
}
setIgnoreHTTPStatus: function ( value ) {
this.ignoreHTTPStatus = value;
}
};
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册