H I O X INDIA
FREE HTML Tutorial
Google
Web hscripts.com
 HOME  ||  Scripts  ||  Purchase  ||  Tutorials  ||  Images  ||  Tools  ||  Directories 
  :-)  Send Page   :-)   Feedback   :-)   Register   :-)   Links   :-)   Support   :-)   Bookmarks :-)  
 Forums   Hosting   Internet Stats   Easy Calculation   FUN Games 

HTML Tutorial
Introduction
How To
HTML Tags
html, head, body
Text Manipulation
IMAGES
Special Effects
Using Tables
Forms
Other Topics
Ask Your Doubts
Feedback





IFrame


Topic

I want a small portion in my page to reload after every interval, how to do it?



Explanation

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

Step1:
Separate the content that needs to be updated dynamically in to a separate page.

Example: itest.php
<html>
<head> </head>

<body bgcolor=green>
Dynamic Content Page
</body>
<html>

Step2:
Add auto refresh to this page.
i.e. copy the meta tag in to the header of the page. (e.g: itest.php)
Example: itest.php
<meta http-equiv="refresh" content="5" >

Step3:
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.

Example: ifexample.php
<html>
<body>
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>
</iframe>
</body>
</html>

We would recommend the time of refresh be above 5 seconds. This is because we have to consider the page loading time.




privacy policy     license     sitemap
© 2004-2005 HIOX INDIA - hioxindia.com

Other Links