"JQuery $.post()"의 두 판 사이의 차이

잔글 (봇: 자동으로 텍스트 교체 (-</source> +</syntaxhighlight>, -<source +<syntaxhighlight ))
 
5번째 줄: 5번째 줄:
* [[jQuery $.ajax()]]과 유사하나 [[POST 방식]] 전용으로 만든 메소드
* [[jQuery $.ajax()]]과 유사하나 [[POST 방식]] 전용으로 만든 메소드


<source lang='jquery'>
<syntaxhighlight lang='jquery'>
$.ajax({
$.ajax({
   type: "POST",
   type: "POST",
13번째 줄: 13번째 줄:
   dataType: dataType
   dataType: dataType
});
});
</source>
</syntaxhighlight>
<source lang='jquery'>
<syntaxhighlight lang='jquery'>
$.post( "example.php", function() {
$.post( "example.php", function() {
   alert( "success" );
   alert( "success" );
27번째 줄: 27번째 줄:
   alert( "finished" );
   alert( "finished" );
});
});
</source>
</syntaxhighlight>


==같이 보기==
==같이 보기==

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

1 개요[ | ]

jQuery $.post()
  • HTTP POST 방식으로 데이터를 받는 jQuery 메소드
  • jQuery $.ajax()과 유사하나 POST 방식 전용으로 만든 메소드
$.ajax({
  type: "POST",
  url: url,
  data: data,
  success: success,
  dataType: dataType
});
$.post( "example.php", function() {
  alert( "success" );
})
.done(function() {
  alert( "second success" );
 })
.fail(function() {
  alert( "error" );
})
.always(function() {
  alert( "finished" );
});

2 같이 보기[ | ]

3 참고[ | ]

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