이 블로그 검색

2010년 9월 7일 화요일

xml사용하기

var xhr =createXMLHttpRequest();
  xhr.onreadystatechange= function(){
     if(xhr.readyState!=4){return;}//요청이 완료되지않았으면 return;
      if(xhr.status!=200){
        //에러처리, 예를 들어 에러 메시지를 화면에 보여준다.
        return; 
     }
     xml=xhReq.responseXML;
     var figure1=xml.getElementsByTagName("figure")[0].firstChild.nodeValue;
  };
  xhr.open("GET", "message.html", true);
  xhr.send(null);

댓글 없음:

댓글 쓰기