在.done Dropzone js上,我在Firefox中完成图像上传之前进行重定向!但不适用于Chrome浏览器。结果是没有上传的图像。我试图在dropzone站点中为fileinput('upload')。on(例如queuecomplete,success ..,function ...)找到一个事件,但没有成功。
results = google.search(query)
for result in iter(results[0:1]):
loc = result.link
我认为此脚本从jquery fileinput.js中获取一些数据
编辑: 得到了同事的帮助。在之后添加: $('#dropzone-input')。fileinput('upload');
$('#form-ajax-upload').on('submit', function(event) {
$(this).find(":submit").prop("disabled", true);
var action = $(this).attr('action');
var data = $("#form-ajax-upload").serializeArray();
$.each(data, function(key,input){
formData.append(input.name, input.value);
});
if($("#uploadBtn").val()){
var file = $("#uploadBtn")[0].files[0];
formData.append("image", file);
}
// console.log(data);
$.ajax({
url: action,
type: "POST",
datatype: "json",
data: formData,
processData: false, // tell jQuery not to process the data
contentType: false, // tell jQuery not to set contentType
})
.done(function(result){
formData.append('model_id', result.id);
formData.append('model_name', result.model);
$('#dropzone-input').fileinput('upload');
window.location.href = result.redirect;
}) .... more
... 现在Firefox等待“ filebatchuploadsuccess”正确