2
콜백 개념이 있지만 그 방법을 모릅니다.성공 데이터가 jquery ajax에 도착했을 때 함수를 실행하십시오.
$.ajax({
'url': '/test/',
'type': 'POST',
'data': {'age': age},
'dataType': 'html',
'success': function(data, textStatus, xhr) {
//I want when the data arrives, then execute another function, because the function is too big to place here.
}
});
그래서 무슨 신호인가요? myFunction의 ture? – user469652
@ user469652 - 위와 마찬가지로, [docs가'success' 콜백에 대해 가지고있는 것과 같은 서명] (http://api.jquery.com/jQuery.ajax/) :'func (data, textStatus, XMLHttpRequest)', 다른 매개 변수를 필요로하지 않는다면, 위와 같이'data'를위한 매개 변수를 하나 가지고 있어야합니다. –