469,330 Members | 1,219 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,330 developers. It's quick & easy.

How to detect the window close event.

I have an parent-child window. I need to refresh the parent window when the child window is closed. I had tried
Expand|Select|Wrap|Line Numbers
  1. <body onunload="window.opener.location.reload();">
When i navigate to different page in the child window , each and every time the parent window is refreshed. I want to refresh it only when the child window is closed. How can i do that?
May 31 '10 #1
3 3163
Dormilich
8,651 Expert Mod 8TB
but when i navigate to different page in the child window , each and every time the parent window is refreshed........
the unload event just means "if you leave this page", this can be either closing the window or loading a new page, so the behaviour you see is correct (in terms of code).
May 31 '10 #2
Thanks for your reply.......

what your saying is true........
but i need to refresh the parent page only when the child page is closed........!!!

How do i do that.......?
Jun 1 '10 #3
acoder
16,027 Expert Mod 8TB
Check from the parent window that the child is closed using the 'closed' property.
Jun 2 '10 #4

Post your reply

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

Similar topics

1 post views Thread by abhay | last post: by
2 posts views Thread by Tony Clarke | last post: by
4 posts views Thread by sm mehta | last post: by
1 post views Thread by bloodandrose | last post: by
5 posts views Thread by jimmy | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by haryvincent176 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.