var XMLHTTPRequest = (function(){ var xhr = function (opt) { this.status = 0 this.readyState = 0 this.response = "" this.responseText = "" this.responseType = "" // "" arraybuffer blob document json text this.responseXML = "" this.statusText = "" this.timeout = 0 this.onreadystatechange = function(){} this.ontimeout = function(){} this.onload = function(){} this.headers = [] this.upload = {} this.withCredentials = false } xhr.prototype.open = function(method, url, async, user, password){ } xhr.prototype.abort = function(){ } xhr.prototype.getAllResponseHeaders = function(){ } xhr.prototype.getResponseHeader = function(){ } xhr.prototype.overrideMimeType = function(){ } xhr.prototype.setRequestHeader = function(key, value){ this.headers.push({ key: key, value: value }) } xhr.prototype.send = function(data){ } })()