'for(;i<5;){',\r
'try{',\r
'return[v[++i],new ActiveXObject(n[i])]',\r
- '}catch(e){return false}',\r
+ '}catch(e){}',\r
'}'\r
].join( '' ) ) )();\r
\r
_type : '',\r
_busy : false,\r
_canceled : false,\r
+ _error : false,\r
_percent : 0,\r
_timerID : 0,\r
\r
break;\r
case 'json' :\r
case 'moz-json' :\r
- raw.responseType = this._type;\r
+ raw.responseType = X_UA.Gecko ? this._type : ''; // Iron 37 でエラー\r
break;\r
case 'document' :\r
case 'xml' :\r
if( raw.timeout !== undefined ){\r
raw.timeout = timeout;\r
} else {\r
- //this._timerID = X.Timer.once( timeout, this, this.onTimeout );\r
+ this._timerID = X.Timer.once( timeout, this, this.onTimeout );\r
}; \r
\r
// send 前にフラグを立てる,回線が早いと raw.send() 内で onload -> _busy = false ののち、 _busy = true するため。\r
this._busy = true;\r
\r
\r
- //raw.send( postbody || '' );\r
- this._timerID = X.Timer.once( 16, this, this._lazySend, [ postbody || '', timeout ] );\r
+ raw.send( postbody || '' );\r
+ //this._timerID = X.Timer.once( 16, this, this._lazySend, [ postbody || '', timeout ] );\r
},\r
- \r
+ /*\r
// send() 内で onload するケースがあり、そのときはイベントリスナが間に合わないので、タイマーをかませる。\r
_lazySend : function( postbody, timeout ){\r
if( this._rawObject.timeout === undefined ){\r
// sendをonreadystatechangeの前に記述すると、ieでは動作しなくなります、、、。\r
// konquerorでエラーが発生するのでここでは、とりあえず、send('') としました。\r
this._rawObject.send( postbody ); \r
- },\r
+ }, */\r
\r
cancel : function(){\r
/* X.Net.XHR.CANCELABLE && */ this._rawObject.abort && this._rawObject.abort();\r
// domes.lingua.heliohost.org/dom-intro/load-save2.html\r
// 規定上は open() を呼び出すと XMLHttpRequest オブジェクトが未送信状態に戻りますが、\r
// Opera 10.10、Safari 4.1 では、同一オリジン制限に違反した XMLHttpRequest オブジェクトは再度 open() しても未送信状態に戻りません。\r
- if( X_UA.Opera || X_UA.Webkit ){\r
- \r
+ \r
+ // Timeout した Gecko の xhr.response に触るとエラー??\r
+ if( X_UA.Opera || X_UA.Webkit || X_UA.Gecko ){\r
+ if( this._error ){\r
+ X_EventDispatcher_toggleAllEvents( this, false );\r
+ this._rawObject = new XMLHttpRequest();\r
+ X_EventDispatcher_toggleAllEvents( this, true );\r
+ };\r
};\r
\r
// XMLHttpRequest の使い方\r
this._rawObject.abort && this._rawObject.abort();\r
\r
this._method = this._type = '';\r
- this._canceled = this._busy = false;\r
+ this._canceled = this._busy = this._error = false;\r
this._timerID && X.Timer.remove( this._timerID );\r
this._percent = this._timerID = 0;\r
},\r
case 'load' :\r
\r
if( !live ) return this.reset();\r
- if( this._percent === 100 ) return;\r
+ if( !this._busy ) return;\r
\r
\r
this._percent = 100;\r
break;\r
};\r
\r
- this.asyncDispatch( { type : X.Event.SUCCESS, status : status || 200, data : data } ); \r
+ this.asyncDispatch( 32, { type : X.Event.SUCCESS, status : status || 200, data : data } ); \r
} else {\r
- live && this.asyncDispatch( { type : X.Event.ERROR, status : raw.status || 0, percent : 100 } );\r
+ live && this.asyncDispatch( 32, { type : X.Event.ERROR, status : raw.status || 0, percent : 100 } );\r
};\r
break;\r
\r
\r
case 'error' :\r
//console.dir( e );\r
- this._busy = false;\r
- live && this.asyncDispatch( { type : X.Event.ERROR, status : raw.status } );\r
+ this._busy = false;\r
+ this._error = X_UA.Opera || X_UA.Webkit;\r
+ live && this.asyncDispatch( 32, { type : X.Event.ERROR, status : raw.status } );\r
break;\r
\r
case 'timeout' : // Gecko 12.0 https://developer.mozilla.org/ja/docs/XMLHttpRequest/Synchronous_and_Asynchronous_Requests\r
- this._busy = false;\r
+ this._busy = false;\r
+ this._error = !!X_UA.Gecko;\r
this.asyncDispatch( X.Event.TIMEOUT );\r
break;\r
};\r