Click here to Skip to main content
15,884,099 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi Team,
How to close a child window after closing a parent window.
I am closing the parent by clicking Close button of the browser(the one with minimize maximize..close X)

Any help appreciated.

Thank,
Lok.
Posted
Comments
Kornfeld Eliyahu Peter 18-Dec-14 4:27am    
By child window do you mean a new browser window was opened from the first one?
Lokesh Zende 18-Dec-14 5:58am    
yes ..

1 solution

Ok, I solved it myself.
I was doing this..
JavaScript
if (this.opener == null )
  // close window;

But I was not getting Opener null. So I tried this..
JavaScript
if (this.opener.closed) {
   this.close();
}


And it works.
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900