js/comm/comm/comm.js in rsence-2.0.0.3.pre vs js/comm/comm/comm.js in rsence-2.0.0.4.pre
- old
+ new
@@ -131,10 +131,17 @@
_this.onFailure = function(resp){console.log('No failure handler specified, response: ',resp);};
}
if(!_options.onSuccess){
_this.onSuccess = function(resp){console.log('No success handler specified, response: ',resp);};
}
+ if(!_options.on302){
+ /** Redirection handler **/
+ _this.on503 = function(_this){
+ var _retryAfter = parseInt(_this.X.getResponseHeader('Retry-After'),10)*1000,
+ _timeout = setTimeout(function(){COMM.request(_this.url,_this.options);},_retryAfter);
+ };
+ }
_this.url = _url;
_this.options = _options;
_this.X = _comm._XMLHttpRequest();
if(_method === 'GET' && _params.length !== 0){
_url += ((_url.indexOf('?')!==-1)?'&':'?')+_comm._arrayToQueryString(_params);
@@ -179,12 +186,12 @@
if(window['XMLHttpRequest']!==undefined){
COMM._XMLHttpRequest = function(){
return new XMLHttpRequest();
};
}
-else if(BROWSER_TYPE.ie){
+else if(window.ActiveXObject){
COMM._XMLHttpRequest = function(){
- return new ActiveXObject("Msxml2.XMLHTTP");
+ return new ActiveXObject("Microsoft.XMLHTTP");
};
}
else {
COMM._XMLHttpRequest = function(){
console.log("No XMLHttpRequest object types known. Can't Communicate.");