![](https://www.cnblogs.com/Images/OutliningIndicators/ContractedBlock.gif)
Code
var xmlHttp
function checkName(str)
{
createXMLHTTP();
var url="Default2.aspx?name="+str;//提交到处理页面
xmlHttp.open("POST",url,true);
xmlHttp.onreadystatechange=checkuserName;
xmlHttp.send(null);
}
function createXMLHTTP()
{
try {
xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
try {
xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
} catch (e2) {
alert("创建对象失败 请更换浏览器");
}
}
}
function checkuserName()
{
if (xmlHttp.readyState==4)
{
if(xmlHttp.status==200)
{
alert(xmlHttp.responseText);//打出返回值
document.getElementById("Text1").value="aaadddcc";
}
}
}
posted @
2009-08-10 17:12
melody&bobo
阅读(
128)
评论()
编辑
收藏
举报