|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
I need a way to verify whether a window is
already open before writing to it to prevent the script from reopening the frame file and wiping out the associated history files. So far I have had no luck with checking for the window name. |
|
#2
|
|||
|
|||
|
Two possibilities... 1- You could write a cookie when you open the window and check for the cookie each time you want to write to the window. Don't forget to change the cookie when you close the window. 2- Look at pages 176-178 of "The Javascript Bible" by IDG Books. It gives an explanation of the window 'close' property. I don't have time right now - there's alot involved. ------------------ Matthew J. Flynn http://webcoder.net |
|
#3
|
|||
|
|||
|
You can use the "closed" property of a window.
For instance: var winTest = window.open("whatever.html"); if (winTest.closed) alert("Window Closed"); else alert("Window Open"); You can also use this on the window.opener object: if (window.opener.closed) alert("Window Closed"); else alert("Window Open"); The problem I've run into is if you open a window, then go back to the opener window and change URL's. Then try to access the window.opener object from the opened window, you no longer have access. ------------------ "It's not where you're from, it's where you're at." S. Dogg |
![]() |
| Viewing: Dev Shed Forums > Web Design > HTML Programming > Verifying a window is open before writing to it |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|