form-serialize

Serializing an array in jQuery

若如初见. 提交于 2019-11-29 17:08:31
问题 How to prepare an array of element for $.ajax submit? Here images return ["val1","val2"] , but after I use $.param(images) I get the following: undefined=undefined&undefined=undefined Here is my code: $('#rem_images').click(function() { var images = new Array(); $('.images_set_image input:checked').each(function(i) { images[i] = $(this).val(); }); alert($.param(images)); return false; } Generally the idea is to check the images to delete on the page, then on a button click loop trough all