如何将数据绑定到表单,以便所有内容都按应有的方式传递给处理程序?
var data = new FormData();
var forma = $("#my_form").serialize();
$.each($("#idea_files")[0].files, function(i, file) {
data.append("files[]", file);
});
$.ajax({
url: $url,
type: "POST",
data: data,
processData: false,
contentType: false,
success: function(data){
console.log(data);
},
error: function( jqXHR, textStatus, errorThrown ){
console.log('ОШИБКА: ' + textStatus );
}
});
https://developer.mozilla.org/en-US/docs/Web/API/FormData/Using_FormData_Objects