다음 코드는 작동하지 않으며 적절한 결과를 반환하지 않습니다.자바 스크립트에서 eventhandler 함수에서 반환?
function test(file) {
var uri = "http://localhost/test.php";
var xhr = new XMLHttpRequest();
var result="done";
xhr.open("POST", uri, true);
xhr.send();
xhr.onloadend=function()
{
result=xhr.responseText;
return result;
}
}
이벤트 처리기에서 돌아 오지 않거나 결과를 테스트 기능으로 돌려 보내겠습니까?
한 가지 문제에 대해 하나 이상의 질문이 있습니까? 질문하기 : http://stackoverflow.com/questions/10847432/xmlhttprequest-object-working-but-not-giving-output-in-response 14 분 전 –