Refresh a page after certain delay jquery
Solution 1
you can use html meta tag for refresh
<meta http-equiv="refresh" content="5; URL=http://www.yourdomain.com/yoursite.html">
Solution 2
if you want to refresh a page after some time with jquery then try this codesetTimeout(function(){
window.location.reload(1);
}, 5000);
window.setTimeout('location.reload()', 3000);
if you want to refresh only one div in every five seconds then try this code
function updateDiv(){ $('#
contentDiv').html(content); //content is your ajax data } setInterval(updateDiv, 5000); // That's five seconds
So, every five seconds the contentDiv(id of your div) content will refresh.and its Better than refreshing the whole page.Related Posts --
Jquery important short codes and functions
Comments
Post a Comment