XML 파일에서 JS 변수로 데이터를 가져오고 싶습니다. (pure JS, jQuery를 사용하고 싶습니다). 파일을 다운로드하는 동안 그러나 나는 항상 오류가 발생했습니다 :JavaScript - XMLHttpRequest 응답 상태 0
var url = "http://www.w3schools.com/xml/note.xml";
var xmlhttp = new XMLHttpRequest();
xmlhttp.open("GET", url, true);
xmlhttp.onreadystatechange = function(event){ processRequest(event,xmlhttp); };
xmlhttp.send();
function processRequest(event,xmlhttp) {
if(xmlhttp.readyState != 4) return;
alert("status: " +xmlhttp.status);
}
응답 XML은 항상 비어 - 응답 상태는 0
여기에 나온 답변을 확인 했습니까? http://stackoverflow.com/questions/2000609/jquery-ajax-status-code-0 – ripu1581