Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

communicating between browsers

Status
Not open for further replies.

ChadBryant

Programmer
Oct 29, 2004
11
US
I've seen some posts about communicating between browser windows using opener, but this question is a little more involved.

Let's say I have a parent window that is the main window for a web app. I click a link in the parent window which opens up child window A. Then I alt - tab back to the parent window (leaving child window A open). I then click another link to open up child window B and do this process until I have 4 child windows, A - D. Let's say in child window D I click a link that opens a page right there within child window D and make some changes that are saved back to a database. Now the changes I just made in child window D cause the data being viewed in child windows A - C to be invalid. If the user ALT-TABs back to one of these other open child windows, then they will be viewing invalid data and we don't want to just assume they'll know they changed something in window D so they know to close and re-open (refresh) the data they were looking at. We don't want them to have to close the windows and reopen them. We want child window D to communicate with the other windows (or broadcast something that the other windows can have an event listener to which they can respond) which basically would make those other child windows display a page that said "The report you were viewing is now invalid. Click here to refresh"

Is this possible?

Thanks in advance!!!!

Chad
 
Take a look at my FAQ here:

faq216-4783

The code can be re-used to do what you desire... When window D detects a change, it can run a callback function in the opener window, which could in turn, call functions on each of the child windows (using the childWindowHandles array).

Hope this helps,
Dan
 
Thanks!!! That is exactly what we need. Now we just have to keep track of a way to selectively communicate with windows. Your example closes all windows but what if you only wanted it to close certain windows? I think I can probably figure something out to handle this. Basically if you have a link in your parent window that opens children A and B and A and B are tied to that link and then they choose another link that opens C and D and then they change something in D...in this case it should only go back and update window C as A and B are unrelated.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top