var xmlHttp;
function creteXmlHttpRequest()
{
if(window.ActiveXObject){
xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
}else if(window.XMLHttpRequest){
xmlHttp = new XMLHttpRequest();
}
}
//开始触发ajax
function checkFirstYYLBName(val)
{
var url;
if(val.length > 0){
url = "serverAjax.asp?sty=checkYYLBname&name="+val;
creteXmlHttpRequest();
xmlHttp.open("GET",url);
xmlHttp.onreadystatechange = handleYYname;
xmlHttp.send(null);
}
}
//回调函数
function handleYYname()
{
document.getElementById("stateload").style.display="block";
if(xmlHttp.readyState == 4){
alert(xmlHttp.status);
if(xmlHttp.status == 200){
document.getElementById("stateload").style.display="none";
                            //可以执行到这里
alert(xmlHttp.responseText);//问题:得不到内容
}
}

}
服务器端正确可以输出‘red’