我想在JavaScript中序列化数组并将序列化的值附加到表单数据中,我尝试过但序列化数组显示为空,请给出建议。
var IsolationFO = {};
IsolationFO['tagNumber'] = $('#tagNumberId').val();
IsolationFO['keyNumber'] = $('#lockProvidedId').val();
var formData = new FormData();
$.ajax({
url: baseURL + 'url',
type: "POST",
contentType: false,
processData: false,
data: function() {
//此处输入显示为空
var inputs = $('#IsolationFO').serializeArray();
$.each(inputs, function(i, input) {
formData.append(input.name, input.value);
console.log("\nSending Data----------------" + input.name + "-----" + input.value);
});
return formData;
}(),