aspose file tools*
The moose likes HTML, CSS and JavaScript and the fly likes How to close parent when child forwards to new URL Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "How to close parent when child forwards to new URL" Watch "How to close parent when child forwards to new URL" New topic
Author

How to close parent when child forwards to new URL

Chris Garrison
Ranch Hand

Joined: Jun 13, 2002
Posts: 44
I have a window (parent).
If the user tries to do something to the parent once the session times out, a new pop-up window 'pops-up' and says "your session has ended click herehere to login again.
Can I have the parent close when the link on the child is clicked?
I'm retarted when it comes to javascript - 0 experience (other than today).
Code examples would be appreciated.
Thansk


May the force be with you, always.
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
You are not going to be able to close the parent without a warning. Instead of having the parent close, have the link populate into the main window.
<a href="javascript:window.opener.location.href='theurl.htm';self.close()">Log-in</a>
Chris Garrison
Ranch Hand

Joined: Jun 13, 2002
Posts: 44
Originally posted by Eric Pascarello:
You are not going to be able to close the parent without a warning. Instead of having the parent close, have the link populate into the main window.
<a href="javascript:window.opener.location.href='theurl.htm';self.close()">Log-in</a>

Excellent!!!
Thanks..... works like a charm.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to close parent when child forwards to new URL