rem: if (urlstring){ this.URLString = urlstring; } if (this.element) { this.elementObj = document.getElementById(this.element); } if (this.xmlhttp) { var self = this; this.xmlhttp.open(this.method, this.requestFile ,true); if (this.method == "POST" && this.xmlhttp.setRequestHeader) { this.xmlhttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded') } if (this.encodeURIString){ this.URLString = this.encodeURLString(this.URLString); } this.xmlhttp.send(this.URLString); this.xmlhttp.onreadystatechange = function() { switch (self.xmlhttp.readyState){ case 1: self.onLoading(); break; case 2: self.onLoaded(); break; case 3: self.onInteractive(); break; case 4: self.response = self.xmlhttp.responseText; self.responseXML = self.xmlhttp.responseXML; self.onCompletion(); if(self.execute){ self.runResponse(); } if (self.elementObj) { self.elementObj.innerHTML = self.response; } break; } }; } }; 
add: this.responseStatus = new Array(2); if(this.failed && this.AjaxFailedAlert){ alert(this.AjaxFailedAlert); } else { if (urlstring){ if (this.URLString.length){ this.URLString = this.URLString + "&" + urlstring; } else { this.URLString = urlstring; } } if (this.encodeURIString){ var timeval = new Date().getTime(); this.URLString = this.encodeURLString(this.URLString); this.setVar("rndval", timeval); } if (this.element) { this.elementObj = document.getElementById(this.element); } if (this.xmlhttp) { var self = this; if (this.method == "GET") { var totalurlstring = this.requestFile + "?" + this.URLString; this.xmlhttp.open(this.method, totalurlstring, true); } else { this.xmlhttp.open(this.method, this.requestFile, true); } if (this.method == "POST"){ try { this.xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded') } catch (e) {} }  this.xmlhttp.send(this.URLString); this.xmlhttp.onreadystatechange = function() { switch (self.xmlhttp.readyState){ case 1: self.onLoading(); break; case 2: self.onLoaded(); break; case 3: self.onInteractive(); break; case 4: self.response = self.xmlhttp.responseText; self.responseXML = self.xmlhttp.responseXML; self.responseStatus[0] = self.xmlhttp.status; self.responseStatus[1] = self.xmlhttp.statusText; self.onCompletion(); if(self.execute){ self.runResponse(); } if (self.elementObj) { var elemNodeName = self.elementObj.nodeName; elemNodeName.toLowerCase(); if (elemNodeName == "input" || elemNodeName == "select" || elemNodeName == "option" || elemNodeName == "textarea"){ self.elementObj.value = self.response; } else { self.elementObj.innerHTML = self.response; } } self.URLString = ""; break; } }; } } }; 
context:   this.runAJAX = function(urlstring){    if (urlstring){ this.URLString = urlstring; }    if (this.element) { this.elementObj = document.getElementById(this.element); }    if (this.xmlhttp) {      var self = this; // wierd fix for odd behavior where "this" wouldn't work in the readystate function.      this.xmlhttp.open(this.method, this.requestFile ,true);      if (this.method == "POST" && this.xmlhttp.setRequestHeader) {        this.xmlhttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded')      }      if (this.encodeURIString){ this.URLString = this.encodeURLString(this.URLString); }      this.xmlhttp.send(this.URLString);      this.xmlhttp.onreadystatechange = function() {        switch (self.xmlhttp.readyState){          case 1: // Loading.            self.onLoading();          break;          case 2: // Loaded.            self.onLoaded();          break;          case 3: // Interactive - is called every 4096 bytes.. pretty much just tells you it's downloading data.            self.onInteractive();          break;          case 4: // Completed.            self.response = self.xmlhttp.responseText;             self.responseXML = self.xmlhttp.responseXML;            self.onCompletion();            if(self.execute){ self.runResponse(); }            if (self.elementObj) {               self.elementObj.innerHTML = self.response;            }          break;        }      };    }  };
meta: 4895	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/4895/95657bc6773c23c04843d51d5224df0bbd5191f0/tw-sack.js/buggy/lib/scripts/tw-sack.js