프로그래밍/web
[Ajax] Ajax 사용
mochitree
2014. 5. 13. 16:37
Ajax 사용하기
$('#partner_send').click(function(){
$('#param_send').click(function(){
var data = $("#param_form").serialize();
/**
* @param type : http
* @param url : 리퀘스트 보낼 url
* @param data : 보낼 데이터
**/
$.ajax({
type: "POST",
url: "페이지 경로",
data: data,
/**
* 송신이 성공했을 경우
**/
success: function(data, dataType) {
alert(data);
},
/**
* 실패한 경우
**/
error : function(XMLHttpRequest, textStatus, errorThrown) {
alert('Error : ' + errorThrown);
}
});
return false;
});