Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > How do I refresh a page automatically

Reply
Thread Tools

How do I refresh a page automatically

 
 
Gram
Guest
Posts: n/a
 
      02-06-2004
Is there another way to automatically refresh or reload a page, other than
using a meta refresh?


 
Reply With Quote
 
 
 
 
Kris
Guest
Posts: n/a
 
      02-06-2004
In article <HlLUb.1652$(E-Mail Removed)>,
"Gram" <(E-Mail Removed)> wrote:

> Is there another way to automatically refresh or reload a page, other than
> using a meta refresh?


Explain the situation and we may be able to supply you with a good
solution.

--
Kris
<(E-Mail Removed)> (nl)
<http://www.cinnamon.nl/>
 
Reply With Quote
 
 
 
 
Gram
Guest
Posts: n/a
 
      02-06-2004
I have a chat room made with ASP ( I know, there are better ways to do this)
and I am using an iframe to display the conversation text so far. So I have
a meta refresh to keep reloading the text at a regular interval, however, I
also have an anchor tag at the end of the text, so it will automatically
scroll to the bottom, but the meta refresh doesn't woork with the extra
#bottom bit.

<META HTTP-EQUIV='REFRESH' CONTENT='30;URL=conversation.asp#bottom'>

Any thoughts?



 
Reply With Quote
 
mscir
Guest
Posts: n/a
 
      02-06-2004


Gram wrote:

> I have a chat room made with ASP ( I know, there are better ways to do this)
> and I am using an iframe to display the conversation text so far. So I have
> a meta refresh to keep reloading the text at a regular interval, however, I
> also have an anchor tag at the end of the text, so it will automatically
> scroll to the bottom, but the meta refresh doesn't woork with the extra
> #bottom bit.
>
> <META HTTP-EQUIV='REFRESH' CONTENT='30;URL=conversation.asp#bottom'>
>
> Any thoughts?


Maybe try using Javascript to refresh the page.

this page has the iframe:

<html>
<head>
<script language="JavaScript" type="text/javascript">
function msgRefresh () {
window.frames['iframe1'].location = "2.html#bottom";
window.setTimeout('msgRefresh()',2000);
}
</script>
</head>

<body onload='msgRefresh()'>
test
<hr>
<iframe height="650" width="600" src="2.html" name="iframe1"
scrolling="yes">This browser does not support...</iframe>
<hr>
test
</body>
</html>



2.html, the page loaded into the iframe, includes:

<a name="bottom">&nbsp</a>

It seems to work on my ie6 and netscape 7.1

MIke

 
Reply With Quote
 
Gram
Guest
Posts: n/a
 
      02-06-2004
Thanks for the help Mike.

It seems to work grand refreshing the page, however it doesn't seem the like
the anchor (#bottom) part. When I have this part in, I can see the browser
try to reload, but the iframe doesn't change.
When I remove the #bottom, it works perfect, with out the scrolling of
course. Is there any way to keep them independant? to get a seperate
function to scroll it to the bottom?

Also, any ideas why a sumbit button doesn't sumbit when hitting the return
key?

Again, Thanks for the help,

Gram.

"mscir" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>
>
> Gram wrote:
>
> > I have a chat room made with ASP ( I know, there are better ways to do

this)
> > and I am using an iframe to display the conversation text so far. So I

have
> > a meta refresh to keep reloading the text at a regular interval,

however, I
> > also have an anchor tag at the end of the text, so it will automatically
> > scroll to the bottom, but the meta refresh doesn't woork with the extra
> > #bottom bit.
> >
> > <META HTTP-EQUIV='REFRESH' CONTENT='30;URL=conversation.asp#bottom'>
> >
> > Any thoughts?

>
> Maybe try using Javascript to refresh the page.
>
> this page has the iframe:
>
> <html>
> <head>
> <script language="JavaScript" type="text/javascript">
> function msgRefresh () {
> window.frames['iframe1'].location = "2.html#bottom";
> window.setTimeout('msgRefresh()',2000);
> }
> </script>
> </head>
>
> <body onload='msgRefresh()'>
> test
> <hr>
> <iframe height="650" width="600" src="2.html" name="iframe1"
> scrolling="yes">This browser does not support...</iframe>
> <hr>
> test
> </body>
> </html>
>
>
>
> 2.html, the page loaded into the iframe, includes:
>
> <a name="bottom">&nbsp</a>
>
> It seems to work on my ie6 and netscape 7.1
>
> MIke
>



 
Reply With Quote
 
mscir
Guest
Posts: n/a
 
      02-06-2004
Gram wrote:
> Thanks for the help Mike.
>
> It seems to work grand refreshing the page, however it doesn't seem the like
> the anchor (#bottom) part. When I have this part in, I can see the browser
> try to reload, but the iframe doesn't change.
> When I remove the #bottom, it works perfect, with out the scrolling of
> course. Is there any way to keep them independant? to get a seperate
> function to scroll it to the bottom?
>
> Also, any ideas why a sumbit button doesn't sumbit when hitting the return
> key?
>


How does this work?

<html>
<head>
<script type="text/javascript">
var milliSecondsToWait = 2000;
function reloadIFrame(){
window.frames['iframe1'].location = "2.html?" + (new Date().getTime());
window.frames['iframe1'].location.hash="#bottom"
myVar = setTimeout("reloadIFrame()",milliSecondsToWait);
}
var myVar = setTimeout("reloadIFrame()",milliSecondsToWait);
</script>
</head>

<body onload='reloadIFrame()'>
test
<p>&nbsp;
<iframe height="450" width="600" src="2.html" name="iframe1"
scrolling="yes">This browser does not support...</iframe>
<p>&nbsp;
test
</body>
</html>

 
Reply With Quote
 
mscir
Guest
Posts: n/a
 
      02-06-2004
> How does this work?
>
> <html>
> <head>
> <script type="text/javascript">
> var milliSecondsToWait = 2000;
> function reloadIFrame(){
> window.frames['iframe1'].location = "2.html?" + (new Date().getTime());
> window.frames['iframe1'].location.hash="#bottom"
> myVar = setTimeout("reloadIFrame()",milliSecondsToWait);
> }
> var myVar = setTimeout("reloadIFrame()",milliSecondsToWait);
> </script>
> </head>
>
> <body onload='reloadIFrame()'>
> test
> <p>&nbsp;
> <iframe height="450" width="600" src="2.html" name="iframe1"
> scrolling="yes">This browser does not support...</iframe>
> <p>&nbsp;
> test
> </body>
> </html>


Sorry, I made a mistake in the script cutting & pasting, should be:

<script type="text/javascript">
var milliSecondsToWait = 5000;
function reloadIFrame(){
window.frames['iframe1'].location = "2.html?" + (new Date().getTime());
window.frames['iframe1'].location.hash="#bottom"
myVar = setTimeout("reloadIFrame()",milliSecondsToWait);
}
</script>

 
Reply With Quote
 
mscir
Guest
Posts: n/a
 
      02-07-2004
Gram, here's a simpler approach, don't know why I didn't think of it sooner:

in the <head> section of your page being loaded into the iframe:

<META HTTP-EQUIV='REFRESH' CONTENT='3; URL='4.htm';>
<script type="text/javascript">
function gotoanchor() {
this.location.hash='#bottom';
}
</script>
</head>


in the <body> section call the function:

<body onload="gotoanchor();">

Does this do it?
Mike

 
Reply With Quote
 
Gram
Guest
Posts: n/a
 
      02-07-2004
Thanks for all the help guys, I'll put it all into action shortly.
I'll be back if there are any problems. :0)

"mscir" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Gram, here's a simpler approach, don't know why I didn't think of it

sooner:
>
> in the <head> section of your page being loaded into the iframe:
>
> <META HTTP-EQUIV='REFRESH' CONTENT='3; URL='4.htm';>
> <script type="text/javascript">
> function gotoanchor() {
> this.location.hash='#bottom';
> }
> </script>
> </head>
>
>
> in the <body> section call the function:
>
> <body onload="gotoanchor();">
>
> Does this do it?
> Mike
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Automatically refresh page when changes had been made to the page Harry Bellafonte HTML 0 11-08-2007 12:24 PM
Refresh HTML page automatically only once vampyreapocalypse@gmail.com HTML 2 11-07-2005 02:36 AM
refresh page automatically me HTML 7 05-13-2005 12:36 PM
Make IE Refresh A Page Automatically lowdes Computer Support 1 07-12-2004 11:56 AM
How do i refresh a datagrid from a pop up window without having to refresh the whole page? Pkenty ASP .Net Web Controls 0 05-28-2004 07:06 AM



Advertisments