title: Display the contents of the lotion through Ajax to refresh the page
body: <p>There is a script that gets through JSON data from the PHP-script. The data are fine. I can not get the data to be updated at intervals. Is updated, but the data are duplicated. Here is a working script that simply displays the data without refreshing.</p>
  
  <pre><code>&lt;script type='text/javascript'&gt; 
  $(document).ready(function(){
    $.ajaxSetup ({  
      cache: false  
    });
    /* call the php that has the php array which is json_encoded */
  
    $.getJSON('api.php', function(data) {
      /* data will hold the php array as a javascript object */
      $.each(data, function(key, val) {
        $('ul').append('&lt;li id="' + key + '"&gt;' + val.date + ' ' + 
        val.event + ' ' + val.region + ' ' + val.host + ' '+ val.type + 
        ' ' + val.info + '&lt;/li&gt;');
      });
    });
  });
  </code></pre>
  
  <p></p>