title: Auto-refreshing chat issues
body: <p>I have a <code>&lt;div id="refresh"&gt;</code> that has some MySQL content in it. I has this JavaScript code for it:</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
      var auto_refreshs_contents = setInterval(
          function(){
              $('#refresh').load('index.php?_=' +Math.random()+' #refresh').fadeIn("slow");  // load div.refresh
          }
      , 3000); // refresh every 3 seconds
  &lt;/script&gt;
  </code></pre>
  
  <p>It actually posts a duplicate of the code the first time so it would look like this:</p>
  
  <pre><code>    0 seconds
  +-------------------------------------+
  |Randome Text                         |
  |This is such a cool chat room        |
  |Not really                           |
  +-------------------------------------+
      3 seconds
  +-------------------------------------+
  |Randome Text                         |
  |This is such a cool chat room        |
  |Not really                           |
  |This is such a cool chat room        |
  |Not really                           |
  +-------------------------------------+
  </code></pre>
  
  <p>If you noticed that, It left out the post "Random Text". I don't know why.
  But yeah, it basically does that the first time. Then after 6 seconds, it refreshes, but doesn't more content, after that, it refreshes right. So I decided to clear the contents of the page right before refreshing it:</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
      var auto_clearContents = setInterval(
          function(){
              $("#refresh").html(""); //clear contents of div#refresh
          }
      , 3000);  //clear existing contents every 3 seconds
  
      var auto_refreshs_contents = setInterval(
          function(){
              $('#refresh').load('index.php?_=' +Math.random()+' #refresh').fadeIn("slow");  // load div.refresh
          }
      , 3000); // refresh every 3 seconds
  &lt;/script&gt;
  </code></pre>
  
  <p>However thats when things get weird. I'm looking at the <code>networks</code> tab in Chrome Developers Tools and it's showing that it refreshes every 200ms or so (yes 200) and sometimes it takes 2.5 seconds. I have no idea...</p>
  
  <p>Is there something wrong with my code? Is there a better way to do it? Thanks!</p>