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 images checked and serialize an array for submit over AJAX to the PHP script.