| Author |
Refresh times to be one
|
Sophia Choi
Ranch Hand
Joined: Mar 22, 2002
Posts: 106
|
|
In HTML, I can refresh a page every 0.5 seconds. <META http-equiv="REFRESH" Content="0.5"> How can I control the refresh times of a page to be once ? Thanks
|
 |
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56231
|
|
If what you are trying to achieve is to cause the page to refresh itself just once a certain period of time after the page is initially loaded, you can create an onLoad handler (that will execute when the page loads) which will use the setTimeout() function to cause another function to execute after your duration has expired. This function would reload the page. Problem is, of course, that your reloaded page will try to do the same thing unless you find a way to tell it not to. You could set and check a cookie (cause the refresh if not set, skip it if so), or (my choice) use a request parameter on your reload that tells the second reload not to refresh. hth, bear
|
[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
|
 |
Sophia Choi
Ranch Hand
Joined: Mar 22, 2002
Posts: 106
|
|
So,after calling a function in setTimeout, do I use request.redirect function to refresh a page or other methods ? Thanks a lot.
|
 |
 |
|
|
subject: Refresh times to be one
|
|
|