-
September 19th, 2008, 01:22 AM
#1
Refresh a Div...
Hello,
I have a page which looks like below:
Code:
<html>
<head>
<title>New Page 1</title>
</head>
<body>
<div>Test1</div>
<div>Test2</div>
<div>Test3</div>
</body>
</html>
and basicly what I want is, I want to be able to every 5 seconds go and refresh the Div parts.
For Example:
in the <div>Test1</div> part I want page1.html to appear and refresh every 5 seconds
in the <div>Test2</div> part I want page2.html to appear and refresh every 5 seconds
in the <div>Test3</div> part I want page3.html to appear and refresh every 5 seconds
anyone know how to do this.
I am only using Javascript (I am not using PHP or ASP)
Thanks.
-
September 19th, 2008, 08:50 AM
#2
Re: Refresh a Div...
If you are not using PHP or ASP (or JSP), only Javascript then every thing is on the client side.
1. I am not sure you really want to stay on the client side.
2. If you stay on the client side, you don't need Ajax, because Ajax is used for updating components in the client page with data coming from the server.
You can set a timer triggering a function that will change the content of your divs with
Code:
document.getElementById('id_of_a_div').innerHTML="bla bla";
-
September 19th, 2008, 09:36 PM
#3
Re: Refresh a Div...
Im creating a program in Visual Basic which will act as a server and pages will be hosted using this program so its like a mini webserver.
-
September 24th, 2008, 03:25 PM
#4
Re: Refresh a Div...
You could use
Code:
<meta content="5" http-equiv="refresh" />
in page1, page2, and page3.html
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|