title: AJAX sequential request to the same page
body: <p>I am trying to make two AJAX requests to the same page one after another. But, I am only getting response of the last request. I have the below code.</p>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;
  &lt;script type="text/javascript"&gt;
  var xmlhttp;
  
  xmlhttp = new XMLHttpRequest();
  
  xmlhttp.open("GET","getcdr.php?r=2",true);
  xmlhttp.send();
  
  xmlhttp.open("GET","getcdr.php?r=4",true);
  xmlhttp.send();
  
  xmlhttp.onreadystatechange=function()
  {
  if (xmlhttp.readyState==4 &amp;&amp; xmlhttp.status==200)
   {
        document.getElementById("myTab").innerHTML=document.getElementById("myTab").innerHTML+xmlhttp.responseText;
   }
  } 
  
  
  &lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;table id="myTab"&gt;
  &lt;tr&gt;&lt;td&gt;SL&lt;/td&gt;&lt;td&gt;MAL&lt;/td&gt;&lt;/tr&gt;
  &lt;/table&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>