我需要将两个FormData对象合并并使用XMLHttpRequest进行提交。其中一个表单包含文件输入。
var formData = new FormData(document.forms.namedItem('form-ship'));
var poData = new FormData(document.forms.namedItem('po-form'));
// Combine them
var fData = $.extend(true, formData, poData);
当我使用$.extend
或者使用serialize()
来合并没有文件输入的表单时,它不起作用。是否有任何想法如何解决这个问题?