$.ajax({
url : "RequestURL",
type : "post", //post,get
dataType : "json", //전송받을 데이터타입 xml,html,script 등
data : {},//서버에 보낼 파라메터
success : function(res, status, xhr){ //통신 성공 시 처리
},
error : function(){ // 통신 오류 시 처리
alert("오류가 발생하였습니다.");
}
});
success, error처리할 때 받는 값들은 임의로 설정 가능
위에 적어놓은 옵션 말고도 tiomeout,contentType,beforeSend,cache 등 많음
댓글 없음:
댓글 쓰기