52,797
社区成员
发帖
与我相关
我的任务
分享
<script language="javascript" type="text/javascript">
var xmlHttp = false;
try {
xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
try {
xmlHttp = new ActiveXObject( "Microsoft.XMLHTTP ");
} catch (e2) {
xmlHttp = false;
}
}
if (!xmlHttp && typeof XMLHttpRequest != 'undefined ') {
xmlHttp = new XMLHttpRequest();
}
function callServer() {
var u_name = document.getElementById( "User_Name").value;
if ((u_name == null) || (u_name == " ")) return;
var url = "2.asp?name= " + escape(u_name);
xmlHttp.open( "GET ", url, true);
xmlHttp.onreadystatechange = updatePage;
xmlHttp.send(null);
}
function updatePage() {
if (xmlHttp.readyState < 4) {
test1.innerHTML= "loading... ";
}
if (xmlHttp.readyState == 4) {
var response = xmlHttp.responseText;
test1.innerHTML=response;
//if (response == 0) {
//test1.innerHTML= "yes ";
//}
//else {
//test1.innerHTML= "no ";
//}
}
}
</script>
<div class="inloginreg h3" style="text-align:center; margin:0;"> 昵 称: <input name="User_Name" type="text"class="input1" id="User_Name" onfocus="this.className='input1-bor'" size="30" onblur="callServer();"> <img src="img/wite.gif" align="absmiddle" /> <br />
<div id="test1" style="background-color:#FF9900;"> </div>