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)}' –