मैं अपनी छवि फ़ाइलों को अपलोड करने के लिए इस स्क्रिप्ट का उपयोग कर रहा हूं: 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
});
});
});
लेकिन जब मैं अपलोड बटन पर क्लिक करता हूं, तो जावास्क्रिप्ट कंसोल इस त्रुटि को लौटाता है:
Uncaught TypeError: Illegal invocation
क्या आप मेरी मदद कर सकते हैं?
dataType: 'json',
???