Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Meta Refresh

 
Arjun Shastry
Ranch Hand
Posts: 1893
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I have PHP page which is refreshed every 5 minutes.Refresh is done using HTML Meta tag.PHP page contains expand and collapsable data.That is user clicks on + ,html table with dynamic data is shown.When he clicks on -, table is collapsed.Problem is after refresh, if table is already shown, due to refresh it gets collpased.How to avoid this?In short:
1)User has clicked on + on php page.
2)He is watching HTML table.
3)After some time, page gets automatically refreshed.
4)HTML table is collapsed.
5)User again has to clik on + to see the same table.

How to avoid this?so that table does not collapse but data is refreshed.
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You would have to remember that the table is open with cookies and when the page loads [or in the php page] read the cookies and reopen that node.

Eric
 
Arjun Shastry
Ranch Hand
Posts: 1893
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks.I can set the cookies in PHP.But if uses minimizes and table is collpased again, I need to call invalidate cookie method(or expire it immediately) so that on page reload, table is not opened.
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So you set the cookie with JavaScript when the user performs an action.

You could also learn about Ajax and not deal with the page refreshing.

Eric
 
Arjun Shastry
Ranch Hand
Posts: 1893
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks.5 minutes interval because records are inserted into database tables every 5/10 minutes.Hence PHP page needs to show status of latest records.Is that possible using AJAX?PHP needs to be run when records are inserted.
[ May 17, 2008: Message edited by: Arjun Shastry ]
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic