0
function stateChanged(idname) {
xmlhttp.onreadystatechange=function() {
if (xmlhttp.readyState==4 && xmlhttp.status==200) {
document.getElementById(idname).value = xmlhttp.responseText;
}
}
}
function openSend(php,idname) {
stateChanged(idname);
xmlhttp.open("GET",php,true);
xmlhttp.send();
}
function showHint() {
if (window.XMLHttpRequest) {
xmlhttp=new XMLHttpRequest();
} else {
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
openSend("time.php", "Time");
openSend("date1.php", "Date1");
openSend("date2.php", "Date2");
return;
}
這兩個說中止(在Firebug中)並且不返回一個值。這是爲什麼?是否因爲我無法發送超過1個請求?爲什麼我不能發送多個請求?
openSend("time.php", "Time");
openSend("date1.php", "Date1");
如果我不能,我怎麼能做到只有一個調用 3個請求?