调用了loadXMLDoc函数后就有问题
var xmlhttp;
var name;
var password;
var sex;
function loadXMLDoc(url,cfunc)
{
if(window.XMLHttpRequest)
{
xmlhttp=new XMLHttpRequest();
}
else{
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.onreadystatechange=cfunc;
xmlhttp.open("POST",url,true);
xmlhttp.setRequestHeader("Content-type","application/x-www-form-urlencoded");
xmlhttp.send("name="+name+"&password="+password+"&sex="+sex);
}
function myFunction(value,url)
{
name = value.name.value;
password = value.password.value;
sex = value.sex.value;
return false;
loadXMLDoc(url,function()
{
if (xmlhttp.readyState==4 && xmlhttp.status==200)
{
document.getElementById("myDiv").innerHTML=xmlhttp.responseText;
}
});
}
var xmlhttp;
var name;
var password;
var sex;
function loadXMLDoc(url,cfunc)
{
if(window.XMLHttpRequest)
{
xmlhttp=new XMLHttpRequest();
}
else{
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.onreadystatechange=cfunc;
xmlhttp.open("POST",url,true);
xmlhttp.setRequestHeader("Content-type","application/x-www-form-urlencoded");
xmlhttp.send("name="+name+"&password="+password+"&sex="+sex);
}
function myFunction(value,url)
{
name = value.name.value;
password = value.password.value;
sex = value.sex.value;
return false;
loadXMLDoc(url,function()
{
if (xmlhttp.readyState==4 && xmlhttp.status==200)
{
document.getElementById("myDiv").innerHTML=xmlhttp.responseText;
}
});
}