title: How to post single in jquery ajax, after all events finished?
body: <p>There are accordion panels, each panel has its own variables in javascript.</p>
  
  <p><strong>I want to save data from each panel in jQuery using something like transaction or queue of POST requests.</strong></p>
  
  <p>Every panel binds its own event to <code>onSave</code> click by preparing the data.</p>
  
  <pre><code>//panel1 that prepares the data
  $("#save").click(function() {
    globalvar['panel1'] = 'somedata';
  });
  //panel2 prepares the data
  $("#save").click(function() {
    globalvar['panel2'] = 2*21+11;
  });
  </code></pre>
  
  <p>How can I make AJAX request, after all panels has been prepared their data?</p>