This week's book giveaway is in the General Computing forum.
We're giving away four copies of Arduino in Action and have Martin Evans, Joshua Noble, and Jordan Hochenbaum 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
Register / Login


JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Reply 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
Bartender

Joined: Oct 01, 2001
Posts: 2550
    
  10

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: 56521
    
  14

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.


[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About 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 agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: How to dynamically refresh a webpage
 
Similar Threads
Help!How to refresh view
How can a page refresh automatically?
JARS are visible threrough RAD 7.0
how to refresh the dispaly in Swing
Upload attachment to QC [Quality Center] using java