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

잔글 (봇: 자동으로 텍스트 교체 (-</source> +</syntaxhighlight>, -<source +<syntaxhighlight ))
 
(사용자 4명의 중간 판 5개는 보이지 않습니다)
7번째 줄: 7번째 줄:
*Ajax 요청 객체 안에서의 콜백
*Ajax 요청 객체 안에서의 콜백


<source lang="javascript">
<syntaxhighlight lang="javascript">
  $.ajax({
  $.ajax({
   beforeSend: function(){
   beforeSend: function(){
17번째 줄: 17번째 줄:
   // ......
   // ......
  });
  });
</source>
</syntaxhighlight>


==글로벌 이벤트==
==글로벌 이벤트==
*document에 의해 동작이 사작됨
*'''document'''에 의해 동작이 시작됨
<source lang="javascript">
<syntaxhighlight lang="javascript">
  $(document).bind("ajaxSend", function(){
  $(document).bind("ajaxSend", function(){
   $("#loading").show();
   $("#loading").show();
27번째 줄: 27번째 줄:
   $("#loading").hide();
   $("#loading").hide();
  });
  });
</source>
</syntaxhighlight>
 
==같이 보기==
* [[jQuery $.ajax()]]


==참고==
==참고==
33번째 줄: 36번째 줄:


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

2020년 11월 2일 (월) 02:52 기준 최신판

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 }}