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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

List Of Open Windows 1

Status
Not open for further replies.

ospreygozo78

Programmer
Jul 4, 2007
5
MT
I am using ajax to have a page routinely query my server to check for any messages and if there are any for me, it will create a new pop up window using the window.open command. Further changes in the message list are reflected in this pop up and the system checks if the pop up window is there, and if not it loads it again.

The problem arises when the opener window is refreshed and the ajax code in it does not know that the pop up is still open and does not reference it to apply the changes.

Is there a way to use javascript to get a list of open pop ups so that I can tell if the pop up is open? And if so, how would I reference this pop up that was loaded in a previous page refresh?

Thanks!
 
You cannot do what you are asking. Your best bet would be to close the popup when the original page is unloaded, and re-open it again after the page has loaded.

These FAQs might be of some help in doing this:

faq216-4783
faq216-6708

Hope this helps,
Dan



Coedit Limited - Delivering standards compliant, accessible web solutions

[tt]Dan's Page [blue]@[/blue] Code Couch
[/tt]
 
Hmm.. Another thought occurs, but I still think you're better off with my previous suggestion. You could, onload, open a popup with the same name as the previous one, and then use the handle to address that.

I've not tried it to see if there are any security restrictions to stop you doing that, but give it a whirl anyway.

Hope this helps,
Dan



Coedit Limited - Delivering standards compliant, accessible web solutions

[tt]Dan's Page [blue]@[/blue] Code Couch
[/tt]
 
Thanks Dan,
The problem is that since this is intended to allow visitors to chat with other members on the same site, a single member might have simultaneous open chat sessions with multiple other members. On page refresh, I need to know which chat sessions were open and keep updateing them.

I could close all the windows, but ideally I need to find a way to know which windows are open, record them, and reload them with the same contents as they were before the refresh of the opener page.
 
Thanks again Dan,
I do know the name of the window. But that is not enough to reference an open pop up. At least not with my limited knowledge of javascript.

So let me reformulate the question. If I know the name of a popup window that was opened in a previous page load, how can I start referncing it?
 
Read my previous post:

Me said:
You could, onload, open a popup with the same name as the previous one, and then use the handle to address that.

I've not tried it to see if there are any security restrictions to stop you doing that, but give it a whirl anyway.

Dan



Coedit Limited - Delivering standards compliant, accessible web solutions

[tt]Dan's Page [blue]@[/blue] Code Couch
[/tt]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top