title: Reload html page with AJAX
body: <p>I have a very simple html page with one table that I would like to reload in the background every 5 seconds. In the background means that solution <code>&lt;meta http-equiv="refresh" content="5"&gt;</code> can not be accepted, because the user can observe reloading process then.</p>
  
  <p>I tried the code below, but I observed that RAM usage was quickly raising and after 2-3 minutes firefox browser consumed 70-80% of available memory:</p>
  
  <pre><code>&lt;script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"&gt;&lt;/script&gt;
  &lt;script&gt;
      function autoRefresh_div()
      {
        $("#employee_table").load("index.html");// a function which will load data from other file after x seconds
      }
  
      setInterval('autoRefresh_div()', 5000); // refresh div after 5 secs
  &lt;/script&gt;
  </code></pre>
  
  <p>Could you please suggest something more efficient?</p>
  
  <p>EDIT:
  I forgot to add that in the body of html I have:</p>
  
  <pre><code>&lt;div id="employee_table"&gt;
  &lt;table&gt;
  ...
  &lt;/table&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>And what I wasn't sure is that I use <code>load("index.html")</code> so I'm loading whole page instead of just a div...?</p>