try this:
Code:
if (window.XMLHttpRequest)
{
xmlhttp=new XMLHttpRequest();
}
else
if (window.ActiveXObject)
{
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
function RSchange() {
if (xmlhttp.readyState==1) {
document.getElementById('div').innerHTML="Loading...";
}
else if (xmlhttp.readyState==4) {
document.getElementById('div').innerHTML=xmlhttp.responseText;
}
}
function go() {
var who=document.getElementsByName("who").value;
var data="who=" + who;
if (xmlhttp) {
//d=document; //didn't seem nessessary
xmlhttp.open("POST", "data.php", true);
xmlhttp.onreadystatechange=RSchange;
xmlhttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
xmlhttp.send(data);
}
}
Bookmarks