You can't post a javascript object, its gotta be key-value pairs.... if the data is coming from a form you can do:
var serial = $('#myform').serialize(); and post the variable serial.... if not then as far as I know you gotta convert the object into key- value pairs some other way! On Sep 9, 6:13 am, Adonis <achrysoch...@hotmail.com> wrote: > Hi, > > I can not upload an array to the server... > > I am using this: > > $.post("/addPolyline/", {project_name:project_name, > polyline_coordinates:vertexArray}, function(data){ > alert("Done"); > > }); > > project_name is a string. > The vertexArray contains coordinates so it could look like this: > [(-11.2323,34.3455),(12.2323,34.3455),(18.2323,-78.3455), > (13.2323,35.3455)]. The server side is fine because it works if i do > not send the array. > > I tried different syntax such as the site recommends(e.g > 'polyline_coordinates[]':vertexArray) but still it does not work... > > Any ideas?