"JQuery Ajax 이벤트"의 두 판 사이의 차이

29번째 줄: 29번째 줄:
</source>
</source>


==참고==
==같이 보기==
* [[jQuery $.ajax()]]
 
==참고 자료==
* https://api.jquery.com/Ajax_Events/
* https://api.jquery.com/Ajax_Events/


[[분류: jQuery]]
[[분류: jQuery]]

2017년 6월 2일 (금) 15:44 판

1 개요

jQuery Ajax Events
  • Ajax 요청시 다양한 이벤트를 생성함
  • 로컬 이벤트글로벌 이벤트로 나눌 수 있음

2 로컬 이벤트

  • Ajax 요청 객체 안에서의 콜백
 $.ajax({
   beforeSend: function(){
     // Handle the beforeSend event
   },
   complete: function(){
     // Handle the complete event
   }
   // ......
 });

3 글로벌 이벤트

  • document에 의해 동작이 시작됨
 $(document).bind("ajaxSend", function(){
   $("#loading").show();
 }).bind("ajaxComplete", function(){
   $("#loading").hide();
 });

4 같이 보기

5 참고 자료

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}