469,315 Members | 1,795 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,315 developers. It's quick & easy.

Refresh page every 5 minutes

Can someone tell me how I can get a page(any page) on the Internet to
refresh automatically every 5 minutes. I was thinking along the lines of
having a HTML file on my C-drive with JavaScript to do so. It should be
possible, Right?

I don't know much about JavaScript.

Thanks for the help.
--
Willem Van der Mescht
ho***@absamail.co.za
http://myweb.absamail.co.za/horsy
(If there were more horses around
the world would be more stabilised)
Jul 20 '05 #1
7 39523
Willem wrote on 29 jun 2003 in comp.lang.javascript:
Can someone tell me how I can get a page(any page) on the Internet to
refresh automatically every 5 minutes. I was thinking along the lines of
having a HTML file on my C-drive with JavaScript to do so. It should be
possible, Right?

I don't know much about JavaScript.


you could build a framepage
and refresh a frame (theirs) from another hidden one(yours)

something like:

function reload1(){
document.parent.frame[1].location.reload()
setTimeout("reload1()",300000)
}
setTimeout("reload1()",300000)

not tested !!!

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Jul 20 '05 #2
It's not javascript and I don't know which browsers support it but
you can put the following in the header:
<meta http-equiv="refresh" content="600">

Mike Johnston
Jul 20 '05 #3
You can also use the meta tag in the head ie. <meta http-equiv="refresh"
content="number of seconds"; url="nextpage.html>"
Jul 20 '05 #4
<html><head><title>a title</title>
<meta http-equiv="refresh" content=300>
</head>
<body>
content
</body>
</html>
-----Original Message-----
From: Willem [SMTP:ho***@absamail.co.za]
Posted At: Sunday, June 29, 2003 10:57 AM
Posted To: comp.lang.javascript
Conversation: Refresh page every 5 minutes
Subject: Refresh page every 5 minutes

Can someone tell me how I can get a page(any page) on the Internet to
refresh automatically every 5 minutes. I was thinking along the lines
of
having a HTML file on my C-drive with JavaScript to do so. It should
be
possible, Right?

I don't know much about JavaScript.

Thanks for the help.
--
Willem Van der Mescht
ho***@absamail.co.za
http://myweb.absamail.co.za/horsy
(If there were more horses around
the world would be more stabilised)


Jul 20 '05 #5
Thanks for the efort you've put in to help me. This is perfect.

Willem Van der Mescht
ho***@absamail.co.za
http://myweb.absamail.co.za/horsy
(If there were more horses around
the world would be more stabilised)

PS Sorry Lasse, didn't mean to use your E-mail address, it was ment to go to
the group.
"Lasse Reichstein Nielsen" <lr*@hotpop.com> wrote in message
news:ad**********@hotpop.com...
"Willem" <ho***@absamail.co.za> writes:
Can someone tell me how I can get a page(any page) on the Internet to
refresh automatically every 5 minutes. I was thinking along the lines of
having a HTML file on my C-drive with JavaScript to do so. It should be
possible, Right?

I don't know much about JavaScript.
Try something like this:
--- reloader.html ---
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN"
"http://www.w3.org/TR/html4/frameset.dtd">
<html>
<head>
<title>Reloader!</title>
</head>
<frameset rows="30, *">
<frame name="input" src="reloaderInput.html">
<frame name="page" src="about:blank">
</frameset>
</html>
------

--- reloaderInput.html ---
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN"
"http://www.w3.org/TR/html4/frameset.dtd">
<html>
<head>
<title>input</title>
<script type="text/javascript">
var interval = undefined;
function go(){

parent.frames['page'].location.href=document.forms[0].elements['url'].value; }
function start(form) {
if (interval) {clearInterval(interval);}
var time = parseFloat(form.elements['time'].value);
interval = setInterval(go,Math.floor(time*1000));
go();
}
function stop() {
if (interval) {
clearInterval(interval);
interval=undefined;
}
}
</script>
</head>
<body>
<div>
<form target="page" action="" onsubmit="start(this);return false;">
<label for="url">URL:<input type="text" id="url"></label>
<label for="time">Frequency in seconds<input type="text" id="time"></label> <input type="submit" value="Go!">
<input type="button" value="Stop" onclick="stop()">
</form>
</div>
</body>
</html>
------

/L
--
Lasse Reichstein Nielsen - lr*@hotpop.com
Art D'HTML: <URL:http://www.infimum.dk/HTML/randomArtSplit.html>
'Faith without judgement merely degrades the spirit divine.'

Jul 20 '05 #6
On Tue, 01 Jul 2003 20:58:38 +0200, Willem wrote:
Thanks for the efort you've put in to help me. This is perfect.

"Lasse Reichstein Nielsen" <lr*@hotpop.com> wrote in message
news:ad**********@hotpop.com...
"Willem" <ho***@absamail.co.za> writes:
> Can someone tell me how I can get a page(any page) on the Internet to
> refresh automatically every 5 minutes. I was thinking along the lines
> of having a HTML file on my C-drive with JavaScript to do so. It
> should be possible, Right?
>
> I don't know much about JavaScript.


Refreshing an entire page on an interval doesn't require scripting it can
be accomplished with a straight HTML META tag, the exact syntax of which
escapes me at the moment.

<META REFRESH='60000'> Something like that. Anyone have the exact syntax?
--
i.m.
All views, opinions and alleged facts expressed by this tactless moron are
protected by the constitution of the United States of America and should be
taken as good natured and friendly unless specifically stated otherwise.

Jul 20 '05 #7
just try this out



window.setTimeout(' window.location="URL"; ',5000);


:)

Harinda
Jul 6 '06 #8

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by SPQR | last post: by
2 posts views Thread by Rob Evans | last post: by
4 posts views Thread by Alejandro Narancio | last post: by
2 posts views Thread by Jarson | last post: by
reply views Thread by Martin Ho | last post: by
10 posts views Thread by Fred Nelson | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
reply views Thread by harlem98 | last post: by
reply views Thread by harlem98 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.