I’m using jquery.fileupload.js and jquery 1.7.2.
<input class="file_upload_start" type="file" name="files[]" original-title="" multiple="multiple">
My file.js: http://www.kcloud.vn/apps/files/js/files.js
$(function () {
$('.file_upload_start').fileupload({
dropZone:$('#content'), // restrict dropZone to content div
add:function (e, data) {
var files = data.files;
var totalSize = 0;
data.submit().success(function (data, status) {
response = jQuery.parseJSON(data[0].body.innerText);
if (response[0] != undefined && response[0].status == 'success') {
var file = response[0];
delete uploadingFiles[file.name];
$('tr').filterAttr('data-file', file.name).data('mime', file.mime);
var size = $('tr').filterAttr('data-file', file.name).find('td.filesize').text();
if (size == t('files', 'Pending')) {
$('tr').filterAttr('data-file', file.name).find('td.filesize').text(file.size);
}
FileList.loadingDone(file.name);
}
When I run it, I get the error:
SCRIPT438: Object doesn’t support property or method ‘submit’
files.js, line 387 character 37
How do fix it?
Below is an excerpt from http://www.kcloud.vn/apps/files/js/files.js up to Line 387. The code comments contain the explanation.