title: Pass array items as multiple params in jQuery AJAX POST
body: <p>I have an array of id's which I wish to pass as a parameter to a webservice via jQuery's $.post like so:</p>
  
  <pre><code>var selections = [1,2,3,4];
  
  $.post('/save', {ids: selections, function(data) {
      // do something
  });
  </code></pre>
  
  <p>Unfortunately the code above submits multiple parameters (which is what I want) but it appends a '[]' to the parameters name so the params sent through when inspected with firebug look like:</p>
  
  <pre><code>ids[] 1
  ids[] 2
  ids[] 3
  ids[] 4
  </code></pre>
  
  <p>The size of the array is dynamic so I can't hardcode it. Is there a dynamic way to do this <strong>without creating a parameter string manually?</strong></p>
  
  <p>Thanks,
    gearoid.</p>
  
  <p><strong>EDIT:</strong></p>
  
  <p>I should also mention that I'm submitting to a Jersey Webservice method which looks like the following:</p>
  
  <pre><code>@POST 
  @Path("save")
  @Produces({"application/xml","application/json"})
  @Consumes("application/x-www-form-urlencoded")
  public Response save();
  </code></pre>