title: How to make two jquery-ajax process at the same time?
body: <p>I trying to call 2 functions in the same page to submit jquery-ajax at the same time to process difference task (function 1 is to instert new records into the database, function 2 is to read the database every 5 sec then display the records from the database on the table in html). </p>
  
  <p>Before I call to function 1, the page working fine with calling to function 2 to read records and display records on the page by every 5 sec, but once I call to function 1 to instert new records, function 2 seem like waiting on the queue and only start process after function 1 compliant. However, I pretty sure this problem is not because of the database been lock while function 1 insterting new records.</p>
  
  <p>Does anyone know how can I make both jquery-ajax processing at the same time? Please see below for more details of my code:</p>
  
  <p>HTML:</p>
  
  <pre><code>&lt;table style='width:100%' border="0"&gt;
      &lt;tr&gt;
          &lt;td width="120"&gt;&lt;input onclick="submitAction()" type="button" value="Process"&gt;&lt;/td&gt;
      &lt;/tr&gt;
  &lt;/table&gt;
  
  &lt;script&gt;
      var myInterval = setInterval('getUpdatedRecord()', 5000);
  &lt;/script&gt;
  </code></pre>
  
  <p>Javascript:</p>
  
  <pre><code>function submitAction()
  {
      var paramList = "Action=make_process";
  
      ajaxRequest = $.ajax({
          url: "ord_process.php",
          type: 'POST',
          data: paramList,
          error: function(){
               msgObj.innerHTML = '&lt;div style="width:313px; padding-top:40px;"&gt;&lt;p class="cAlign"&gt;Connecton error.&lt;br&gt;Please try again.&lt;/p&gt;&lt;/div&gt;';
                  },
          success: function(data){
           var endDateTime = getCurrentDateTime();
           msgObj.innerHTML = ''; 
          alert("  "+data+"\n\n  Start Date&amp;Time : "+startDateTime+"\n    End Date&amp;Time : "+endDateTime)
              }   
       });    
  }
  
  
  
  function getUpdatedJobRecord()
  {
      var paramList = "Action=get_job_record&amp;call=ajax";
  
      ajaxRequest = $.ajax({
              url: "ord_process.php",
              type: 'POST',
              data: paramList,
              error: function(){
                  msgObjB.innerHTML = update_date;
                  msgObjA.innerHTML = '&lt;td&gt;&lt;div style="width:313px; padding-top:40px;"&gt;&lt;p class="cAlign"&gt;Connecton error.&lt;br&gt;Please try again.&lt;/p&gt;&lt;/div&gt;&lt;/td&gt;';
              },
              success: function(data){
                  msgObjB.innerHTML = update_date;
                  msgObjA.innerHTML = data;
              }       
      }); 
  }
  </code></pre>