此函数始终返回未定义但警报显示正确的值。
function _gesamt()
{
var link = "speichern.php?gesamt=true";
//alert(link);
var req = new XMLHttpRequest();
req.onreadystatechange = function(){
//alert("Ready:"+req.readyState);
if(req.readyState == 4){
alert(req.responseText);
return req.responseText;
}
}
req.open("GET",link,false);
req.send();
}