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

Window.Open() Question

Status
Not open for further replies.

Mighty

Programmer
Feb 22, 2001
1,682
US
Guys,

I have a form page which, when submitted, opens a pop-up window informing the user that the input is being processed, blah, blah.

The form input gets sent to an ASP page(trackorder1.asp). The first thing that the ASP page does is create a reference to the open windown using window.open and when the ASP program has completed processing, it closes the open window. The user then makes a selection from this new page and submits to trackorder2.asp. Now my problem is that if the user uses the back button to make a different selection trackorder1.asp tries to generate a reference to a window that doesn't exist so it open a blank pop-up window.

So after all that my question is: is it possible to check if a window is open so that I can do something like

if (window is open) {
generate reference to window
} Mise Le Meas,

Mighty :)
 
Hi.

Try with closed property of windows object.

Possible Values

bClosed Boolean that receives one of the following values:
false Default. Window is open.
true Window is closed.


The property is read-only. The property has a default value of false.

regards, Kirilla
 
Kirilla,

I don't see how I can use the closed property because I no longer have the original reference that I used to open the window. Without this reference, I cannot check to see if the window is still open.

It's kind of Catch-22 - I need to reference to check if the window is open. But I want to check if the window is open to determine whether I need to create a reference to it or not.
Mise Le Meas,

Mighty :)
 
I'm sure with a frame to hold your variable and some onload/unload events you can figure this out. You could even try storing the reference in a frame that won't change. jared@eae.net -
 
Guys,

I'm still at a loss.
Is it possible to check what the last opened page was and use this as the check.

i.e. if (history.back()=page2.htm) {
create window reference
} Mise Le Meas,

Mighty :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top