if(typeof parsedRequest == "undefined"){ parsedRequest = true; var __Requests = new Object(); function Request(id, baseURL){ try { Request.baseConstructor.call(this, 0, 0, 0, 0, 0); this.init(id, baseURL) } catch(e) { alert("Request: Fehler in Conctructor ("+e+")"); } } OOP.extend(Request, BaseComponent); Request.prototype.init = function(id, baseURL){ try { this.id = id; this.baseURL = baseURL; this.waiting = false; __Requests[id] = this; var xmlRequest = null; if (typeof XMLHttpRequest != 'undefined') { xmlRequest = new XMLHttpRequest(); } if (!xmlRequest) { // Internet Explorer 6 und älter try { xmlRequest = new ActiveXObject("Msxml2.XMLHTTP"); } catch(e) { try { xmlRequest = new ActiveXObject("Microsoft.XMLHTTP"); } catch(e) { xmlRequest = null; alert("Bitte aktivieren Sie ActiveX-Steuerelementeun versuch Sie es erneut."); } } } this.xmlRequest = xmlRequest; } catch(e) { alert("Request.init: "+e); } } Request.prototype.setIdPrefix = function(prefix) { __Requests[this.id] = null; Request.superClass.setIdPrefix.call(this, prefix); __Requests[this.id] = this; } Request.prototype.renderTo = function(el) { this.isRenderd = true; return el; } Request.prototype.send = function(strMethod, strURL) { try { if (this.waiting) {return;} this.waiting = true; var url = this.baseURL + "?" + encodeURI(strURL); this.xmlRequest.open(strMethod, url, true); eval("this.xmlRequest.onreadystatechange = function() {processRequest(__Requests['"+this.id+"'])};"); this.xmlRequest.send(null); } catch(e) { alert("Request.send: "+e); } function processRequest(self) { if (self.xmlRequest.readyState == 4) { /* Request processing complete */ self.waiting = false; if (self.xmlRequest.status == 200) { /* http: success */ self.callback(self); } else { /* alert("Mist " + self.xmlRequest.status); */ } } } } Request.prototype.getResponseText = function() { try { return this.xmlRequest.responseText; } catch(e) { alert("Request.getResponseText: "+e); } } Request.prototype.getResponseArray = function() { try { var myArray = new Array(); myArray = eval('(' + this.xmlRequest.responseText + ')'); return myArray; } catch(e) { alert("Request.getResponseArray: "+e); } } /** * Wird ausgelöst, wenn eine Antwort eintrifft */ Request.prototype.callback = function(sender) {} }