Hello, instead of doing a usual page refresh in the page itself, I need one from a .js script. Here’s where I’m at with help. Trying to get the page address below to refresh at midnight of every night.
From the .js script:
function tii(){window.setTimeout(“location.href=’
function ti(){with(new Date){
yr = getFullYear(); // the year
mt = getMonth()+1; // the month
dy = getDate(); // todays day number}
fromMidnight = new Date(yr,mt,dy,0,0,0,0).getTime();
toMidnight = 86400000 – fromMidnight;
setTimeout(‘tii()’,toMidnight);}}
from the body of the page, including it with another function so I can have more than one script on my page.
<script type=”text/javascript”>
window.onload=function(){afunction();ti();}</script>
Can anyone see why this isn’t refreshing my page at midnight? Thanks very much.