응답에 의해 호출된 함수에 적용
XMLHttpRequest 의 상태를 표시할 수 있다.
| <SCRIPT LANGUAGE="JavaScript"> <!-- function proc(){ httpReq = getXMLHttpRequest(); httpReq.onreadystatechange = hey ; httpReq.open("GET", "test.php", true); httpReq.send(null); } function hey(){ if(httpReq.readystate==0){ alert("open매소드 호출되지 않음"); }else if(httpReq.readystate==1){ alert("send 매소드가 호출 되지 않는 상태"); }else if(httpReq.readystate==2){ alert("status 와 헤더는 도착하지 않은 상태"); }else if(httpReq.readystate==3){ alert("데이터 일부를 받은 상태"); }else if(httpReq.readystate==4){ alert("데이터전송 완료"); } } //--> </SCRIPT> <input type="button" value="호출" onclick="proc()"> |


::: 사람과 사람의 교감! 人터넷의 첫 시작! 댓글을 달아주세요! :::