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.
<script type='text/javascript'>
$(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('<li id="' + key + '">' + val.date + ' ' +
val.event + ' ' + val.region + ' ' + val.host + ' '+ val.type +
' ' + val.info + '</li>');
});
});
});