title: firing multiple ajax request and these are showing the same result?
body: <p>I am firing multiple ajax request through <code>setinterval()</code> function and these request bring some information from another page but these requests are bringing same information from both requests.<br>
  here is Javascript the code</p>
  
  <pre><code>function views()
  {
      setInterval(function(){var xmllhttp
      //alert("views")
      if (window.XMLHttpRequest)
      {
          xmlhttp=new XMLHttpRequest()
      }
      else
      {
          xmlhttp=new ActiveXObject("Microsoft.XMLHTTP")
      }
  
      xmlhttp.onreadystatechange=function()
      {
          if (xmlhttp.readyState==4 &amp;&amp; xmlhttp.status==200)
          {
              document.getElementById("latestviews").innerHTML=xmlhttp.responseText
          }
      }
  
      xmlhttp.open("GET","latestviews.php")
      xmlhttp.send()},5000);
  }
  
  function recentposts()
  {
      setInterval(function()
      {
          var xmllhttp
          //alert("recent")
          if (window.XMLHttpRequest)
          {
              xmlhttp=new XMLHttpRequest()
          }
          else
          {
              xmlhttp=new ActiveXObject("Microsoft.XMLHTTP")
          }
  
      xmlhttp.onreadystatechange=function()
      {
          if (xmlhttp.readyState==4 &amp;&amp; xmlhttp.status==200)
          {
          document.getElementById("latest").innerHTML=xmlhttp.responseText
          }
      }
  
      xmlhttp.open("GET","recent.php")
      xmlhttp.send()},5000);
  }
  </code></pre>
  
  <p>Here is the html code</p>
  
  <pre><code>&lt;body onload="views(),recentposts()"&gt;
      &lt;div class="latest" id="latest"&gt;
          &lt;span class="latestin"&gt;
              &lt;label class="label"&gt;&lt;i&gt;Recent Post&lt;/i&gt;&lt;/label&gt;
          &lt;/span&gt;
          &lt;?php
              $con1 = mysqli_connect('127.0.0.1','root','root','databasetry');
              $result=mysqli_query($con1,"SELECT articleid,title FROM article order by articleid desc LIMIT 6");
              $divid=0;
  
              while($row = mysqli_fetch_array($result))
              {   
                  $id=0;  
                  $id=$row['articleid'];
                  echo"&lt;div class='recent' onclick='ajaxinput($id)' id=$id style='cursor:pointer;'&gt;";
                  echo $row['title']."&lt;br&gt;";
                  echo"&lt;/div&gt;";
              }
  
              mysqli_close($con1);
          ?&gt;
  
          &lt;/div&gt;
              &lt;div class="latestviews" id="latestviews"&gt;
              &lt;span class="latestin"&gt;
                  &lt;label class="label"&gt;&lt;i&gt;Top viewed Post&lt;/i&gt;&lt;/label&gt;
              &lt;/span&gt;
              &lt;?php
                  $con1 = mysqli_connect('127.0.0.1','root','root','databasetry');
                  $result=mysqli_query($con1,"SELECT articleid,title FROM article order by views desc LIMIT 6");
                  $divid=0;
  
                  while($row = mysqli_fetch_array($result))
                  {   
                      $idd=0; 
                      $idd=$row['articleid'];
                      echo"&lt;div class='recent' onclick='ajaxinput($idd)' id=$idd style='cursor:pointer;'&gt;";
                      echo $row['title']."&lt;br&gt;";
                      echo"&lt;/div&gt;";
                  }
                  mysqli_close($con1);
              ?&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  &lt;/body&gt;
  </code></pre>