카테고리 없음
ajax 예제
우주정복☆
2015. 9. 21. 13:37
$.ajaxSettings.traditional = true; //data 배열설정
$.ajax({
url : '주소입력',
type : 'post',
dataType : 'text', //반환 type
async : true, //비동기식
//enctype: "multipart/form-data",
//processData: false, //첨부파일 업로드시 필수
//contentType: false, //첨부파일 업로드시 필수
data : {
"변수명" : DATA
},
beforeSend : function() {
//로딩중...
},
complete : function() {
//통신이 실패했어도 완료되었을때 호출
},
success : function(data, status, xhr) {
},
error : function(xhr, status, error) {
}
});