Trending News
Home / Web Development / jQuery / Automatically Load Content and Refresh Div Using jQuery

Automatically Load Content and Refresh Div Using jQuery

Good Morning Guys,
Automatically reload and displaying the content without reloading the page is very important in web application. Specially this technique is used in news or magazine website for latest news, organization website, banking site for notification etc. You can directly display content in your website from database and automatically change it after fixed interval of time. There are times when you need to refresh some part of your web page in a specific interval of time (I recommend three seconds).

This tutorial teaches you how to load contents from an external page or file into your current page and refreshes these contents every 3 seconds with the help of PHP and Jquery.

Let’s see how you can achieve this:

Main part of this tutorial is the jQuery code. This is very simple:

datas.php file is responsible for what data is to be displayed.
You can either fetch data from any file or database tables.

Code for datas.php

Code for index.php

If anyone has doubts on this topic then please do let me know by leaving comments or send me an email.

Loading Facebook Comments ...
Social Media Auto Publish Powered By :