Refresh page every 5 minutes

W

Willem

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
(e-mail address removed)
http://myweb.absamail.co.za/horsy
(If there were more horses around
the world would be more stabilised)
 
E

Evertjan.

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 !!!
 
M

Mike Johnston

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
 
L

Liu, Chunyen

<html><head><title>a title</title>
<meta http-equiv="refresh" content=300>
</head>
<body>
content
</body>
 
W

Willem

Thanks for the efort you've put in to help me. This is perfect.

Willem Van der Mescht
(e-mail address removed)
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 said:
Willem said:
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"
 
I

Ivan Marsh

Thanks for the efort you've put in to help me. This is perfect.

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?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,764
Messages
2,569,566
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top