[Ajax] loop 안에서의 문제
글쓴이: puaxx / 작성시간: 목, 2006/02/16 - 10:49오전
var http_request=Array();
for(var h=0;list.length>h;++h){
http_request[h]=make_http();
http_request[h].onreadystatechange=function statehandler(){
if (http_request[h].readyState == 4) {
if (http_request[h].status == 200) {
// do something
} else {
alert('There was a problem with the request.');
}
}
}
http_request[h].open('GET',url, true);
http_request[h].send(null);
}
문제가 있습니다..
이런식으로 했을때에..
for루프문에 끝난후에 statehandler가 동작하게 되면 오브젝트를 찾을수 없는 에러가 뜨는군요.
이 문제를 어떻게 해결해야 될지 난감합니다.
Forums:


Re: [Ajax] loop 안에서의 문제
eval로 해결
댓글 달기