You are here: irt.org | FAQ | JavaScript | Redirect | Q707 [ previous next ]
It would be easier if it were just every 30 minutes -- you could then just use a META tag to refresh the location. But to refresh on the hour and at half past the hour, you will need JavaScript:
<SCRIPT LANGUAGE="JavaScript"><!--
function startTimer() {
var now = new Date();
var minutes = now.getMinutes();
var seconds = now.getSeconds();
setTimeout('refresh()',(((30 - (minutes % 30) - ((seconds>0)?1:0)) * 60) + (60 - seconds)) * 1000);
}
function refresh() {
window.location.href = 'http://www.irt.org/';
}
startTimer();
//--></SCRIPT>