Reputation: 1393
i am using the code bellow to reload a php file after 20 seconds inside a div, bu the problem is that after the first load on my target div it doesn't show anything.
any suggestions?
my code:
function getMyVideos(){
$("#myvideos").load("http://www.mydomainz.com/myfile.php", function(){
setTimeout(getMyVideos, 20000);
});
}
$(document).ready(getMyVideos);
<div id="myvideos"></div>
Thank you all!
Upvotes: 0
Views: 182
Reputation: 4100
You can probably use an anonymous function in your setTimeout
function :
setTimeout(function(){getMyVideos();}, 20000);
Upvotes: 1