Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Auto Refresh GrandParent window after closing popup

Status
Not open for further replies.

ssepai

Programmer
Feb 19, 2008
3
US
Hi every one!

I have a window(A) which opens a popup(B)... which further opens another popup(C) and closes
it self but the parent remains open and the newly created popup does some processing and closes
itself... i would like to refresh the main Parent i.e A

I did try window.top but then it constantly refers to window (C) and window.opener does not work because (B) has already been closed.

Any help would be appreciated.

Thank you.
 
Don't let "B" close itself. Get "C" to store a reference to "B"'s parent "A", then close "B".

Ie for the third window:
Code:
var grandparent = window.opener.opener;
function closeParent(){
  window.opener.close();
}

Call closeParent() in your onload event for the third page rather than letting it close itself and you will ensure that you've saved a reference to the grandparent page.

You can then do things like:
Code:
grandparent.document.getElementById("myid").innerText = "Hi There";
Without any problems.

[sub]Never be afraid to share your dreams with the world.
There's nothing the world loves more than the taste of really sweet dreams.
[/sub]

Webflo
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top