This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes HTML, CSS and JavaScript and the fly likes How to dynamically refresh a webpage 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 "How to dynamically refresh a webpage" Watch "How to dynamically refresh a webpage" New topic
Author

How to dynamically refresh a webpage

Akshay Jain
Greenhorn

Joined: Dec 29, 2011
Posts: 5
Hello
If a website has pages A and B, and someone presses a button A, how do you update/refresh all existing page B still connected to the server.
Thanks in Advance.
Greg Charles
Sheriff

Joined: Oct 01, 2001
Posts: 2931
    
  12

Do you mean pages A and B are opened in two separate windows (or tabs) and you want page B to refresh after a button on page A is clicked?
Akshay Jain
Greenhorn

Joined: Dec 29, 2011
Posts: 5
yes; however, if page B is open in many different windows/tabs, and someone presses the button on page A, i want all of the windows/tabs where page B is open to refresh
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 63211
    
  69

Are they independent windows? Or were they all opened from the same parent using window.open()?

If the former, you're out of luck. You'll need to have the pages poll the server (via Ajax most likely) to see if there's a change of state that should trigger a refresh.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Akshay Jain
Greenhorn

Joined: Dec 29, 2011
Posts: 5
Its the former(they are independent windows)....do you mean that i would have to use php to check the server every few seconds for new information? or is there another way to do it....
 
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
 
subject: How to dynamically refresh a webpage
 
It's not a secret anymore!