Programming/Web
ajax 순차적으로 진행을 위한 방법
Chan_찬
2014. 5. 23. 11:24
반응형
1st ajax success부분에 2nd ajax 로직을 넣어라.
function ajaxModule(DATA,Url,Fn){
$.ajax({
type:"POST", //POST GET
url:Url, //PAGEURL
data : DATA,
timeout : 30000, //제한시간 지정
cache : false, //true, false
success: function whenSuccess(arg){ //SUCCESS FUNCTION
Fn(arg);
},
error: function whenError(x,e){ //ERROR FUNCTION
ajaxErrorAlert(x,e);
}
});
}
$.ajax({
type:"POST", //POST GET
url:Url, //PAGEURL
data : DATA,
timeout : 30000, //제한시간 지정
cache : false, //true, false
success: function whenSuccess(arg){ //SUCCESS FUNCTION
Fn(arg);
},
error: function whenError(x,e){ //ERROR FUNCTION
ajaxErrorAlert(x,e);
}
});
}
728x90
반응형
BIG