blufish Posted June 3, 2008 Share Posted June 3, 2008 HELLO FOLKS! On my website I have function that gets information out of a php file and puts it in a div, can anyone here tell me how to repeat this function over and over without any interaction with the user (like clicking a button.) All help would be appreciated. Link to comment https://forums.phpfreaks.com/topic/108504-solved-javascript-looping-a-function/ Share on other sites More sharing options...
Psycho Posted June 3, 2008 Share Posted June 3, 2008 Use setTimeout() or setInterval(). window.onload = doSomething; function doSomething ( ) { // (do something here) setTimeout ( "doSomething()", 5000 ); //Repeats every 5 seconds } Link to comment https://forums.phpfreaks.com/topic/108504-solved-javascript-looping-a-function/#findComment-556696 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.