qq_遁去的一_1
Response.Write();//在页面输出//ajax代码function createXMLHttpRequest() {if (window.ActiveXObject) {//如果是IE浏览器return new ActiveXObject("Microsoft.XMLHTTP");}else if (window.XMLHttpRequest) {//非IE浏览器return new XMLHttpRequest();}}var xhr = null;function ChicKUserName() {var name = document.getElementById("txtUserName").value;//请求字符器var url = "LoginUserName.aspx?UserName=" + name;//1.创建XMLHttpRequestxhr = createXMLHttpRequest();//2.设置回调函数xhr.onreadystatechange = readyDo;//3.初始化XMLHttpRequest组件xhr.open("get", url, true);//4.发送请求xhr.send(null);}function readyDo() {if (xhr.readyState==4&&xhr.status==200) {var result = xhr.responseText;//对返回结果进行处理if (result == "true") {document.getElementById("div1").innerHTML="用户名已存在";}else {document.getElementById("div1").innerHTML = "用户名可以使用";}}}