我该如何进行这项工作?我正在尝试做 AJAX 帖子。我习惯做 .serialize 但我想向数组添加另外两个值和键。我怎样才能轻松做到这一点?
$('#moreprojects').click(function(){
var skip = $(this).attr('name');
var more = $(this).attr('rel');
var param = $('#companies').serializeArray();
param.push({name: 'skip', value: skip})
param.push({name: 'more', value: more})
$.post('projectsmore.php', {param}, function(response){
$('#projects tbody').append(response);
})
})