메소드 new XMLHttpRequest();
페이지 정보

본문
var req = new XMLHttpRequest();
req.open('GET', 'http://srw.co.kr/crezone_ai/', true);
req.onreadystatechange = function (aEvt) {
if (req.readyState === 4){
if(req.status === 200){
var trg = eval("("+req.responseText+")");
console.log(trg);
}else{
console.log("Error loading page\n");
}
}
/*
// resayState
0 : open() 이 아직 호출되지 않음
1 : send() 가 호출되지 않음
2: 서버로부터 응답이 없음
3: 데이터를 받는 중
4: 서버로부터 응답을 다 받았음
//status
"200" ; Section 10.2.1 : Ok
"204" ; Section 10.2.5 : No Content
"400" ; Section 10.4.1 : Bad Request
"500" ; Section 10.5.1 : Internal Server Error
"503" ; Section 10.5.4 : Service Unavailable
*/
};
req.send(null);
- 이전글location.href, location.pathname.toLowerCase() 18.12.08
- 다음글웹페이지 내용 복사 방지 (드래그 방지) 18.11.21
댓글목록
등록된 댓글이 없습니다.

