/* sendet eine ajax-anfrage per post an url data wird json-kodiert als variable "data" an das script gesendet handler ist eine funktion mit den argumenten(antwort,data,request) dabei ist antwort ein objekt, data das data-objekt aus der anfrage und request das XMLHttpRequest-Objekt das script liefert eines datensatz der form { list:[ [ausgabewert,...], [ausgabewert,...], ... ] } */ var itkMiniAjaxModul={ file: "miniajax.js" } function ajaxRequest(url,data,handler) { var xmlHttp = null; // Mozilla, Opera, Safari sowie Internet Explorer 7 if (typeof XMLHttpRequest != 'undefined') { xmlHttp = new XMLHttpRequest(); } if (!xmlHttp) { // Internet Explorer 6 und älter try { xmlHttp = new ActiveXObject("Msxml2.XMLHTTP"); } catch(e) { try { xmlHttp = new ActiveXObject("Microsoft.XMLHTTP"); } catch(e) { xmlHttp = null; } } } var dummy={}; var json1=dummy.toJSONString ? true : false; if (xmlHttp) { xmlHttp.open('POST', url, true); xmlHttp.onreadystatechange = function () { if (xmlHttp.readyState == 4) { if (json1) handler(xmlHttp.responseText.parseJSON(),data,xmlHttp); else handler(JSON.parse(xmlHttp.responseText),data,xmlHttp); } }; if (json1) xmlHttp.send("data="+encodeURIComponent(data.toJSONString())); else xmlHttp.send("data="+encodeURIComponent(JSON.stringify(data))); return true; } else return false; } try { itkModul.loadDone(itkMiniAjaxModul); } catch (e) {}