title: Sending an array of objects as ajax post data?
body: <p>My overall goal is to get all some of all drop-downs on a page and send that to be processed by a php file.</p>
  
  <p>Right now, the way I'm doing it in jQuery is making an overall schedule array and then adding each element to be updated to that array. So I have something like:</p>
  
  <pre><code>var schedule = [];
  var data = { 
     'user_id' : '12', 
     'day_of_week' : 'Monday',
      'when' : 'start',
      'time' : '12 AM'
   }
  schedule.push(data);
  var data = { 
     'user_id' : '13', 
     'day_of_week' : 'Tuesday',
      'when' : 'end',
      'time' : '12 AM'
   }
  schedule.push(data);
  // schedule would have two objects in it
  </code></pre>
  
  <p>Obviously in loops and and stuff.</p>
  
  <p>So, my schedule array has two objects in it, in this case.</p>
  
  <p>Now, is it possible to use that schedule array as the ajax data? It doesn't work if I do something like:</p>
  
  <pre><code>$.ajax({
    url: 'http://something.com/ajax',
    data: schedule,
    type: 'POST'
  });
  </code></pre>
  
  <p>But if I instead change it to <code>schedule[0]</code> it works just fine, but only for the first thing in the schedule array, obviously.</p>