01.
<div=
"app"
></div>
02.
<script>
03.
$(document).ready(
function
(){
04.
setInterval(fetchdata,5000);
05.
});
06.
07.
function
fetchdata(){
08.
$.ajax({
09.
url:
'fetchdata.php'
,
10.
type:
'post'
,
11.
success:
function
(res){
12.
$(
'#app'
).
empty
().append(res);
13.
}
14.
});
15.
}
16.
</script>