function batch(){
var dataArr = [];
$('#line').each(function(){
let obj = {name : $('#name').val(),sex : $('#sex').val()};
dataArr.push(obj)
});
if (dataArr.length > 0) {
$.ajax({
'url': 'url',
'type': 'POST',
'data': {data:JSON.stringify(dataArr)},
'dataType': 'json',
'success': function (result) {}
});
} else {
return false;
}
}
Last modification:February 1, 2021
© Allow specification reprint
Comment here is closed