Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Refresh every minute, on the minute.

Reply
Thread Tools

Refresh every minute, on the minute.

 
 
Denebola
Guest
Posts: n/a
 
      02-27-2006
I am trying to refresh my webpage every minute, on the minute and so
far have the script below in the <head> of my page:

<SCRIPT LANGUAGE="JavaScript"><!--
function startTimer() {
var now = new Date();
var minutes = now.getMinutes();
var seconds = now.getSeconds();
setTimeout('refresh()',(((((seconds>0)?1:0)) * 60) + (60 -
seconds)) * 1000);
}

function refresh() {
window.location.href = 'http://www.bbc.co.uk';
}

startTimer();
//--></SCRIPT>

The problem is that if i visit this page at say 25 seconds past the
minute, it won't refresh at the next minute change (in 35 seconds) but
will wait til the next minute to do so (i.e. in 95 seconds).

Where am I going wrong......??

Regards

 
Reply With Quote
 
 
 
 
Chris Smith
Guest
Posts: n/a
 
      02-27-2006
Denebola <(E-Mail Removed)> wrote:
> I am trying to refresh my webpage every minute, on the minute and so
> far have the script below in the <head> of my page:
>
> <SCRIPT LANGUAGE="JavaScript"><!--


You want comp.lang.javascript. This is comp.lang.java.programmer.

--
www.designacourse.com
The Easiest Way To Train Anyone... Anywhere.

Chris Smith - Lead Software Developer/Technical Trainer
MindIQ Corporation
 
Reply With Quote
 
 
 
 
saryada@gmail.com
Guest
Posts: n/a
 
      02-27-2006
Have you tried to use the <META http-equiv refresh>? Here is an
example:

<meta http-equiv="Refresh" content="n;url">

Put this meta tag inside your html <head> tag.

Where n is the number of seconds to wait before refreshing and url is
the url to be reloaded.

Regards,
I Wayan Saryada

 
Reply With Quote
 
Denebola
Guest
Posts: n/a
 
      02-27-2006

Chris Smith wrote:
> You want comp.lang.javascript. This is comp.lang.java.programmer.


Oops...my apologies..... I'll try there... thank you.

 
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
How to Refresh CSS File on Every Page Request (no caching) Jeremy S ASP .Net 5 05-30-2009 03:49 PM
Refresh page in another frame every x seconds Rule-Ur-Wayz HTML 5 11-26-2007 01:35 AM
Explorer.exe error report every time access every type of video me =?Utf-8?B?SXJ3YW5zeWFo?= ASP .Net 4 10-30-2007 07:49 AM
refresh some pages every 2 seconds Kevin ASP .Net 3 09-30-2005 01:11 AM
refresh a page every so often Laszlo Szijarto ASP .Net 3 07-02-2003 12:56 PM



Advertisments