By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,844 Members | 1,859 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,844 IT Pros & Developers. It's quick & easy.

how to check if a popup is close?

100+
P: 123
how to check if a popup is close?

thanks.
Jan 16 '09 #1
Share this Question
Share on Google+
3 Replies


acoder
Expert Mod 15k+
P: 16,027
Use the window.closed property:
Expand|Select|Wrap|Line Numbers
  1. if (!win || win.closed) {
  2. // window closed...
  3. }
Jan 16 '09 #2

100+
P: 123
no matter the popup is open or closed...the alert still never run..
why?

thanks a lot.

Expand|Select|Wrap|Line Numbers
  1.  
  2. win =window.open("fillsn.htm", "name", "width=600,height=600");
  3.  
  4. if (!win || win.closed) {
  5. alert("closed");
  6. }
  7.  
Jan 16 '09 #3

acoder
Expert Mod 15k+
P: 16,027
Again, there's not enough time for it to register. Use a button:
Expand|Select|Wrap|Line Numbers
  1. <input type="button" value="Is it closed?" onclick="isClosed();">
Jan 16 '09 #4

Post your reply

Sign in to post your reply or Sign up for a free account.