이 스크립트를 사용하여 이미지 파일을 업로드하고 있습니다. http://jsfiddle.net/eHmSr/
$('.uploader input:file').on('change', function() {
$this = $(this);
$('.alert').remove();
$.each($this[0].files, function(key, file) {
$('.files').append('<li>' + file.name + '</li>');
data = new FormData();
data.append(file.name, file);
$.ajax({
url: $('.uploader').attr('action'),
type: 'POST',
dataType: 'json',
data: data
});
});
});
그러나 업로드 버튼을 클릭하면 JavaScript 콘솔이 다음 오류를 반환합니다.
Uncaught TypeError: Illegal invocation
도와주세요?
dataType: 'json',
???