I am setting up a page and I want to leave messages for users that insist on pressing the refresh button 100 times a minute rather than waiting for the auot-refresh.
Figure I would do it with cookies
write a cookie at the time of download that contains the current time.
then the page is first opened see if the current time is greater than 30 seconds that of the cookie time. If it is leave a message asking them not to keep pressing refresh (like that will work!). Then write the cookie again
i would think this would work
---------------------------------------------------------
LastT = document.cookie.split("=")[1]
Current = new Date
Current = Current.getTime()
if (LastT > Current-30000) {
document.write('Hey stop pressing refresh!')
}
document.cookie = Current
---------------------------------------------------------
the problem is the current cookie reads up the new value even though I wouln't think it had been written yet
HELP!


Reply With Quote