검색결과 리스트
글
336x280(권장), 300x250(권장), 250x250, 200x200 크기의 광고 코드만 넣을 수 있습니다.
파일업로드 시 서버호출을 AJAX로 할 때 파일업로드가 실패한다.
이유는 파일객체를 서버로 제대로 전달하지 못해서 인데, FormData를 쓰면 제대로 파일객체를 전달할 수 있다.
// 전송하려는 form의 ID가 frm일 때
var form = new FormData(document.getElementById('frm'));
$.ajax({dataType : 'json',
url : '/test.jsp',
data : form,
type : 'text',
processData: false,
contentType:false,
type: 'post',
success : function(data) {
},
error : function(data) {
}
});
Appends a new value onto an existing key inside a
Deletes a key/value pair from a
Returns the first value associated with a given key from within a
Returns an array of all the values associated with a given key from within a
Returns a boolean stating whether a
Sets a new value for an existing key inside a
$.ajax({dataType : 'json',
url : '/test.jsp',
data : form,
type : 'text',
processData: false,
contentType:false,
type: 'post',
success : function(data) {
},
error : function(data) {
}
});
FormData.appendFormData object, or adds the key if it does not already exist.FormData.deleteFormData object.FormData.getFormData object.FormData.getAllFormData.FormData.hasFormData object contains a certain key/value pair.FormData.setFormData object, or adds the key/value if it does not already exist.'-- JQuery' 카테고리의 다른 글
| $.each 메소드 사용시 break, continue 사용 (0) | 2017.01.24 |
|---|---|
| JQuery data() (0) | 2015.11.16 |
| when, done, then (0) | 2014.11.24 |
| IE8, IE9에서 placeholder 적용되게 하는 방법 (0) | 2014.09.02 |
| 특정 레이어만 프린트 (0) | 2014.08.22 |
RECENT COMMENT