This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to close parent when child forwards to new URL

 
Chris Garrison
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Don't get me started about those stupid light bulbs.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic