• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Refresh times to be one

 
Sophia Choi
Ranch Hand
Posts: 106
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 65123
91
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Sophia Choi
Ranch Hand
Posts: 106
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So,after calling a function in setTimeout, do I use request.redirect function to refresh a page or other methods ?
Thanks a lot.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic