JQuery make an array - how/what is best
- by russp
I have 4 serailized arrays that I want to pass to php for processing. What is the best way to combine them into a single array
example:
serial_1 = $('#col1').sortable('serialize');
serial_2 = $('#col2').sortable('serialize');
serial_3 = $('#col3').sortable('serialize');
serial_4 = $('#col4').sortable('serialize');`
each serialized array relates to a column/section of the page (col1,col2 etc.) What I need to do/would like to do is create a single array that puts the serialized array inside another array for a single post.
example:
var new_array = serilaize(col_1(serial_1),col2(serial_2),col3,(serial_3),col4(serial_4))
I KNOW THAT IS NOT RIGHT as I have no idea in JQuery how to right the correct syntax.
This new array is to be posted via ajax like this:
$.ajax({
url: "test.php",
type: "post",
data: new_array,
error: function(){
alert('SOME ERROR MESSAGE');
}
});
Thanks in advance