:
$.post("someScript.php", function(data) {
/*This callback function is executed when the AJAX call returns successfully
You would do something with your dropdown items here
and then call your next function.*/
});
다양한 jQuery를 AJAX 방법 (post
는 get
, 예를 들어 load
)을 모두 전달하는 방법을 제공합니다 인수로서의 콜백 콜백은 서버로부터의 성공적인 응답시 실행됩니다. 그 콜백 함수 안에는 응답을 포함하는 data
을 다루기 위해 필요한 코드를 실행할 수 있습니다.
jQuery를 사용하지 않는 경우 이미 XMLHttpRequest
개체가 있다고 가정합니다.
xhr.onreadystatechange = function(){
if(xhr.readyState == 4) {
//This will be reached if the call returns successfully
}
}
아이디어는 위의 jQuery를 방법과 동일합니다 : XMLHttpRequest
당신이 때 상태 변경을 실행하는 기능을 할당 할 수있는 onreadystatechange
라는 속성이 있습니다.
좋아요! jQuery가 트릭을 수행했습니다. 고마워요! –
문제 없습니다. 다행입니다. :) –