Having an issue where I'm trying to refresh the content of my <div>
every 5 seconds. Strangely, it was working fine a few days ago and I haven't made any changes to the code since then.
However, after 5 seconds, the <div>
disappears and the content is not updated. It just completely vanishes.
This is the code I'm using:
<script type="text/javascript">
setInterval("myx_function();",5000);
function myx_function() {
$('#refresh').load(location.href + ' #time');
}
</script>
<div id="refresh">
<div id="time">
<?php echo date('H:i:s');?>
</div>
</div>
Does anyone have any insight into what might be causing this issue?