2016-04-20 13:21:01 +00:00
|
|
|
APIClass.prototype={xhr:[],send:function(b,c,f){b.hasOwnProperty("path")||c({ModuleError:4});for(var a=0;a<this.xhr.length;a++)4==this.xhr[a].readyState&&(this.xhr=this.xhr.slice(0,a-1).concat(this.xhr.slice(a,this.xhr.length-1)));this.xhr.push(null);a=this.xhr.length-1;this.xhr[a]=window.XMLHttpRequest?new XMLHttpRequest:new ActiveXObject("Microsoft.XMLHttpRequest");console.log(b);var d=this;this.xhr[a].onreadystatechange=function(){if(4==d.xhr[a].readyState)if(-1<[0,200].indexOf(d.xhr[a].status))try{c(JSON.parse(d.xhr[a].responseText))}catch(b){c({ModuleError:1})}else c({ModuleError:3})};
|