Monday, May 20, 2024
 Popular · Latest · Hot · Upcoming
157
rated 0 times [  162] [ 5]  / answers: 1 / hits: 40312  / 14 Years ago, mon, january 24, 2011, 12:00:00

I've seen ways of seeing if a window a particular script opened is still opened, but what if it didn't?



I have a small window that has a button to click to load the large window. When I close the large one, I want a particular onUnload or onBeforeUnload to fire iff the small one is closed; if it's still open, those procedures will not fire. I may be having simply a massive brain fart but I can't figure out how to check if the other window is open. The big one isn't opening it, so I can't simply record the handle from opening it.



In shorter terms: If window A opened window B, how can I check within window B if window A still exists?


More From » javascript

 Answers
59
if(window.opener && !window.opener.closed)
alert('Yup, still there.');

[#94075] Saturday, January 22, 2011, 14 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
breap

Total Points: 606
Total Questions: 96
Total Answers: 108

Location: Djibouti
Member since Sun, Feb 27, 2022
2 Years ago
breap questions
Thu, Jun 24, 21, 00:00, 3 Years ago
Wed, Mar 18, 20, 00:00, 4 Years ago
Mon, Oct 7, 19, 00:00, 5 Years ago
;