JQuery

Auto Refresh Div Every X Seconds using JQuery

Let’s see how we can refresh the content of a div every 5 seconds using JQuery library:

Assuming that you have already include JQuery library in your web application, append these lines of code:

1
2
3
4
 
var auto_refresh = setInterval(function () {
	$('#my_div_id').load('http://path_to_my_web_app/my_page.php').fadeIn("slow");
}, 5000); //milliseconds!

That’s it!