I am trying to send some data to the server.
on the server it should be going to http://www.sample.com/data2
I have a Array as arrays;
var = arrays;
this arrays has the value.
I am doing
$.post('/data2', {arrays});
This is not working…
this is inside the .submit(). I can see in firebug it is giving Error for the variable as “invalid object initializer”
Im assuming your var
arraysis[1,2,3,etc..]which you can’t just wrap with
{}brackets…you need to give a key to your value, such as..{"arr" : arrays}If your using PHP, your array would be held in the $_POST array in the index “arr”, like…
$arr = $_POST['arr'];