What you are looking for is setTimeout
.
$("#accordion").accordion({
collapsible: true,
icons: {
activeHeader: "ui-icon-triangle-1-s",
header: "ui-icon-triangle-1-e"
}
});
setInterval(makePostCall, 15000); // decide interval to fetch new updates. 15 sec for example
function makePostCall(){
$.post('preprocessor.php', '&show=', function(data) {
$("#accordion").html(data);
});
}
But this is not the proper way of doing this kind of stuff. Consider using Ajax Push Engine