$("#CreateReportObject").click(function () {
var report_array = [];
var object_id;
$("#report-container [id^='report-']").each(function (index) {
var reportObject = {
subject: $("#name-report-" + index).text(),
photo: $("input[name='subject-photo-" + index + "']")[0].files[0],
rating: $("input[name='subject-rating-" + index + "']").val(),
comment: $("textarea[name='subject-comment-" + index + "']").val(),
};
report_array.push(reportObject);
object_id = $("input[name='object_id-" + index + "']").val();
});
console.log(report_array);
您好!我在report_array
中收集了一系列对象。它在控制台中给我这个:
如何通过ajax将其发送到php?
请注意,我还需要在php中获取所有照片。我怎样才能做到这一点?