I'm using setInterval in a function to load a php file every 10 seconds. When the page loads it's not immediately loading the php file the very first time then loading it every 10 seconds thereafter.
<script>
setInterval(function(){
$('#loadthis').load('loadthis.php');
},10000);
</script>