Meaningless Drivel is fun!*
The moose likes HTML, CSS and JavaScript and the fly likes Meta Refresh Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Meta Refresh" Watch "Meta Refresh" New topic
Author

Meta Refresh

Arjun Shastry
Ranch Hand

Joined: Mar 13, 2003
Posts: 1871
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.


MH
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
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

Joined: Mar 13, 2003
Posts: 1871
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

Joined: Nov 08, 2001
Posts: 15376
    
    6
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

Joined: Mar 13, 2003
Posts: 1871
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 ]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Meta Refresh
 
Similar Threads
Caching Problems with borwsers.
Help??
Detecting if user clicks refresh
Cache control through response object.
How to identify when refresh button of browser or f5 is pressed