展会信息港展会大全

asp+ajax检测用户名是否在存
来源:互联网   发布日期:2016-03-01 11:02:21   浏览:1726次  

导读:!DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.0 Transitional//EN html head title asp+ajax检测用户名是否在存/title meta name=Generator content=EditPlus meta name=Author content= meta name=Keywords content= meta name=Description content= /head bod...

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

<html>

<head>

<title> asp+ajax检测用户名是否在存</title>

<meta name="Generator" content="EditPlus">

<meta name="Author" content="">

<meta name="Keywords" content="">

<meta name="Description" content="">

</head>

<body>

<script language="JavaScript" type="text/javascript">

<!--

function checkUserName(userName){

//建立跨浏览器的XMLHttpRequest对象

var xmlhttp;

try{

xmlhttp= new ActiveXObject('Msxml2.XMLHTTP');

}catch(e){

try{

xmlhttp= new ActiveXObject('Microsoft.XMLHTTP');

}catch(e){

try{

xmlhttp= new XMLHttpRequest();

}catch(e){}

}

}

//创建请求,并使用escape对userName编码,以避免乱码

xmlhttp.open("get","checkUserName.asp?userName="+escape(userName));

xmlhttp.onreadystatechange=function(){

if(xmlhttp.readyState==4){

if(xmlhttp.status==200){

//根据responseText判断用户名是否存在

if(xmlhttp.responseText=="1")alert("对不起,该用户名以存在!");

else alert("恭喜!该用户名未被注册!");

}else{

alert("网络失败。");

}

}

}

xmlhttp.send(null);

}

//-->

</script>

</body>

</html>

赞助本站

人工智能实验室

相关热词: 开发 编程 android

AiLab云推荐
展开

热门栏目HotCates

Copyright © 2010-2024 AiLab Team. 人工智能实验室 版权所有    关于我们 | 联系我们 | 广告服务 | 公司动态 | 免责声明 | 隐私条款 | 工作机会 | 展会港