title: Submit ajax request one by one with each()
body: <p>i tried to submit multiple form using ajax, but how to send one by one, i mean send the first ajax after done/success then send second ajax, below is my script:</p>
  
  <pre><code>&lt;form&gt;
   &lt;input type="text" name="name" value="john doe" size="60"&gt;
   &lt;input type="text" name="age" value="23" size="2"&gt;
  &lt;/form&gt;
  
  &lt;form&gt;
   &lt;input type="text" name="name" value="Alex" size="60"&gt;
   &lt;input type="text" name="age" value="24" size="2"&gt;
  &lt;/form&gt;
  
  &lt;button&gt;Submit&lt;/button&gt;
  
  
  &lt;script&gt;
  function post_form_data(data) {
      $.ajax({
          type: 'POST',
          url: 'https://members.lelong.com.my/Auc/Member/Feed/feed.asp',
          data: data,
          success: function () {
              console.log('Success');
          },
          error: function () {
              console.log('error');   
          }
      });
  }
  
  $('button').on('click', function () {
      $('form').each(function () {
          post_form_data($(this).serialize());
      });
  });
  &lt;/script&gt;
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/J7m5Q.jpg" alt="enter image description here"></p>