I need to send an array via ajax, but for some reason it will not send, I suspect it is due to serialisation.
So how would I create the array so it is ajax compatible?
I need the array in this format, a key value pair where the value is another array.
[order: Array[1], type: Array[1]]
I declare my array like so:
filters = [];
If the inputs are checked I add them to the array.
var order = $('input[name="order[]"]:checked').map(function(){return this.value;}).get();
if(!$.isEmptyObject(order))this.filters['order'] = order;
....
With the idea, if no inputs are selected, the array is blank and therefore is not sent by ajax.
How can I maintain the structure of the array but make it compatible with ajax?