使用JQuery Ajax进行数组发布

I found many posts about that, but nothing for me :(

I'm using Jquery-Plugin DataTable and I have many tables in a form (But i don't know how many).

I should get the formdata from the plugin with:

objDataTables.each(function(index){
    dtArray[$(this).attr('id')] = $('input', $(this).fnGetNodes()).serialize();
});

How can i send the dtArray to the server per $.ajax I tried to creat an Object dtArray = {} but it still not working. The postdata are an empty string every time.

Anybody have an Idea why or how?

Thanks.

Note: I don't using JSON.stringify(...)

Are you certain the data you wish to send is in either an input or textarea tag? Other elements, such as tables, wont be collected by the serialize function.

If the data is not in input or textarea fields but you still want to collect it, then you will have to iterate through all rows and columns.

I get it :) Create an Object and not an Array. Note: Don't serialize the Object. If anyone else have the same case... my Solution

var tData = {};
for(var index in dtArray){
    tData[index] = $('input', dtArray[index].fnGetNodes()).serialize();
};

and in Ajax:

$.ajax({
    url: 'ajax.php',
    type: "POST",
    dataType: "json",
    timeout: 4000,
    data: { func: "ajax", formData: tData },
    success: function(data, textStatus, jqXHR){
        // to do
    },
    error: function(jqXHR, textStatus, errorThrown){
        // to do
    }
});