[jQuery] $.post not working with object arrays
Hello,
Whenever I try to pass an object containing array data through jQuery
AJAX only the
last value of the array is sent. Consider this example:
var test = new Object();
test.arr = new Array(1, 2, 3);
$.post("script.php", test, callback);
If I print_r($_POST) in the script.php all I get is:
Array ( [arr] => 3 )
Instead of:
Array ( [arr] => Array ( [0] => 1 [1] => 2 [2] => 3 ) )
Any idea what's causing this? Thanks