0

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>
michelle
  • 623
  • 2
  • 6
  • 22

1 Answers1

0

That's the normal behavior of setInterval... Just add $('#loadthis').load('loadthis.php'); before your setInterval call. That's it. – Seblor 1 min ago

michelle
  • 623
  • 2
  • 6
  • 22