I'm using this script to upload my image files: 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
});
});
});
But when I click in upload button, the JavaScript console returns this error:
Uncaught TypeError: Illegal invocation
Can you help me?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…