ajax登陆返回值判断,一个简单的ajax用户登陆返回值问题?有代码
一個簡單的ajax用戶登陸返回值問題?有代碼
來源:互聯網??2009-11-13 11:55:56??評論
分類: 電腦/網絡 >> 程序設計 >> 其他編程語言
問題描述:
————aaa.asp 文件————————————
Using responseText with innerHTMLvar xmlHttp;
function createXMLHttpRequest() {
if (window.ActiveXObject) {
xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
}
else if (window.XMLHttpRequest) {
xmlHttp = new XMLHttpRequest();
}
}
function startRequest() {
createXMLHttpRequest();
xmlHttp.onreadystatechange = handleStateChange;
//xmlHttp.open("post", "bb.html", true);
xmlHttp.open("POST", 'bbb.asp?name='+document.getElementById("name").value + "&pwd=" + document.getElementById("pwd").value, true);
//xmlHttp.open("POST", "bbb.asp", true);
xmlHttp.send(null);
}
function handleStateChange() {
if(xmlHttp.readyState == 4) {
if(xmlHttp.status == 200) {
document.getElementById("results").innerHTML = xmlHttp.responseText;
}
}
}
姓名:
密碼:
總結
以上是生活随笔為你收集整理的ajax登陆返回值判断,一个简单的ajax用户登陆返回值问题?有代码的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 文件服务器换个用登录,文件服务器迁移 登
- 下一篇: 织梦网站上传服务器不显示图片,织梦网站图