I am trying to run a function every 30 seconds but setInterval waits 30 seconds then runs it repeatedly. So if there are any other methods of going about this. (Without 3rd party plugins)
Any help would be appreciated
Based on the answer from "Schechter" but fixed to run on the first page load and then runs every 30 secs.
function myFunction(){
console.log('myFunction Called')
}
myFunction();
setInterval(function(){
myFunction()
}, 30000)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With