I want a small portion in my page to reload after every interval, how to do it?
As in the question, some time we may face a situation where only a small portion or content of the page should be dynamically updated after every few seconds. Then it is not wise to load the full page. Then we go for iframe.
Here we do it in three steps
Separate the content that needs to be updated dynamically in to a separate page.
Dynamic Content Page
Add auto refresh
to this page.
i.e. copy the meta tag in to the header of the page. (e.g: itest.php)
<meta http-equiv="refresh" content="5" >
Set the dynamic page in to our main page using iframe.
Here we use tables and the iframe page is set in site one of the table columns.
This is iframe test page. You can see that only the content in the below box, which is a iframe gets loaded after every 5 second. <br><br>
<iframe src="itest.php" width=100 height=100 frameborder=0 scrolling=no>
We would recommend the time of refresh be above 5 seconds. This is because we have to consider the page loading time.