473,322 Members | 1,540 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

How to display several web page with loop

Hi all,

I am new in javascript and I hope someone can help me. I would like to
write a web page with 2 frame, left and right. When browse the web
page, it will read a file from the hard disk. The file format is as
follow:

a.html
b.html
c.html

The left hand side will display all these filename. The right hand
side will browse these web pages one by one with loop (i.e. a.html ->
b.html -> c.html -> a.html ...). Can anyone teach me how to do this?
Many thanks.

Regards,
Dovelet
Jul 23 '05 #1
4 1894

"dovelet" <do*********@yahoo.com.hk> wrote in message
news:e4**************************@posting.google.c om...
Hi all,

I am new in javascript and I hope someone can help me. I would like to
write a web page with 2 frame, left and right. When browse the web
page, it will read a file from the hard disk. The file format is as
follow:

a.html
b.html
c.html

The left hand side will display all these filename. The right hand
side will browse these web pages one by one with loop (i.e. a.html ->
b.html -> c.html -> a.html ...). Can anyone teach me how to do this?


You don't need JavaScript to do that. In the pages that will loop on the
right side, include two lines in the <head> section:

<base target="_self">
<meta http-equiv="refresh" content="1;url=X.html">

where X in the url is "b" for the "a" page, "c" for the "b" page, and "a"
for the "c" page. The "1" calls for a 1-second delay.

It should work for any browser that respects the HTTP-EQUIV meta tag.

Probably not what you are looking for, but I just had to throw that out
there as a possibility.
Jul 23 '05 #2
Hi MyndPhlyp,

Thanks of your reply. However, as the web pages "a.html", "b.html" &
"c.html" are not owned by me, I cannot add some header in these pages.
Do you or someone have any ideas? Thanks.

Regards,
Dovelet

Jul 23 '05 #3
Dovelet wrote on 31 dec 2004 in comp.lang.javascript:
Thanks of your reply. However, as the web pages "a.html", "b.html" &
"c.html" are not owned by me, I cannot add some header in these pages.
Do you or someone have any ideas? Thanks.


so you are realy talking about another domain's pages?
<body style='margin:0;'>
<iframe id=ifr style='width:100%;height:100%;'></iframe>

<script type='text/javascript'>
var i=0
var ifr=document.getElementById('ifr')

function f(){
if (i==0) ifr.src="http://otherDom.com/a.html"
if (i==1) ifr.src="http://otherDom.com/b.html"
if (i==2) ifr.src="http://otherDom.com/c.html"

i++
if (i>2)i=0
setTimeout('f()',5000)
}
f()

</script>

IE6 tested

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Jul 23 '05 #4
Hi Evertjan,

It is work! Thanks.

Dovelet

Evertjan. wrote:
Dovelet wrote on 31 dec 2004 in comp.lang.javascript:
Thanks of your reply. However, as the web pages "a.html", "b.html" & "c.html" are not owned by me, I cannot add some header in these pages. Do you or someone have any ideas? Thanks.


so you are realy talking about another domain's pages?
<body style='margin:0;'>
<iframe id=ifr style='width:100%;height:100%;'></iframe>

<script type='text/javascript'>
var i=0
var ifr=document.getElementById('ifr')

function f(){
if (i==0) ifr.src="http://otherDom.com/a.html"
if (i==1) ifr.src="http://otherDom.com/b.html"
if (i==2) ifr.src="http://otherDom.com/c.html"

i++
if (i>2)i=0
setTimeout('f()',5000)
}
f()

</script>

IE6 tested

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)


Jul 23 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: RIck Measham | last post by:
I have a dynamically generated table, filled from a database by a perl application. Each row represents a database record and has a 'status' and a unique 'id'. What I want to do is create...
3
by: RAllsopp | last post by:
I have a client who would like to have several pictures associated with one system. I have read about storing only the pathname to save OLE overhead and have set-up a form for my client to...
12
by: Wadim Grasza | last post by:
I want to store and display (on a form or a report) multiple pictures per record in an access database. The pictures are not stored within the database. They are stored as files and the database...
3
by: Meena Desai | last post by:
Hi, In my .aspx page there are some .jpg images. When I browse the page using IE6, it goes into an infinite loop in downloading the image. No image is displayed after that. If I browse .htm page...
6
by: Ben | last post by:
I am trying to write codes in VB.net to display 3 images in series on a Webform with each image being displayed in the same box for 5 seconds. I am trying to use Timer and image button, don't...
5
by: Chris | last post by:
I have a meetings section I'm developing on our intranet. Using PHP/MySQL. Meeting info and Meeting docs reside on 2 related tables in the db. Users may want to upload anywhere from 1 to 10 or...
1
by: Benny Ng | last post by:
Dear All, Now I met one problem in the development of my one application. I have one ASP.NET page. It's for disply the information of customer. But now I have one new requirement. It's to...
9
by: tshad | last post by:
This was posted before but the message got messed up (all NLs were stripped out for some reason). I have 2 labels that hold the name of different images on my .aspx page. <asp:Label ID="Logo"...
1
by: cccc2046 | last post by:
hi, i am a rookies in ASP.Net(C#). and i am using visual studio 2005 i am creating a webpages.and using CSS, Master page, and Content page in my CSS ( myStyle.css) i set my background picture...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.