<script language="Javascript" type="text/javascript">
<!--
// globale Instanz von XMLHttpRequest
var xmlHttp = false;
function AjaxRequest()
{
try {
xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
}
catch(e) {
try {
xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
}
catch(e) {
xmlHttp = false;
}
}
// falls nicht vorhanden, Objekt fuer Mozilla, Opera oder Safari anlegen
if (!xmlHttp && typeof XMLHttpRequest != 'undefined')
xmlHttp = new XMLHttpRequest();
return xmlHttp;
}
function AjaxResponse(request_type, response_string, argument_string)
{
// XMLHttpRequest Objekt
xmlHttp = AjaxRequest()
if (xmlHttp)
{
switch(request_type)
{
case "GET":
xmlHttp.open('GET', './test.php?action=' + response_string + '&rq=' + argument_string, true);
xmlHttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
xmlHttp.onreadystatechange = response_string;
xmlHttp.send(null);
break;
case "POST":
xmlHttp.open('POST', './test.php?action=' + response_string + '&rq=' + argument_string, true);
xmlHttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
xmlHttp.onreadystatechange = response_string;
xmlHttp.send(null);
break;
}
}
}
function getUserName()
{
alert("TEST");
}
//-->
</script> |