0
我的代码,例如部分:的XMLHttpRequest:POST请求状态
var xhr = new XMLHttpRequest();
xhr.open("POST", "http://someurl.com", true);
xhr.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
xhr.onreadystatechange = function() {
if (xhr.readyState == 4) {
if (xhr.status == 200) {
doSomeTask();
}
}
}
xhr.send('login=mylogin&password=mypassword');
我怎么能知道我的登录密码&是正确的?在两种情况下,xhr.status都是200.
控制台中显示的内容是什么? //'if(xhr.status == 200){console.log(xhr.responseText)}' – 2012-02-05 12:23:36