aspose file tools*
The moose likes HTML, CSS and JavaScript and the fly likes JS: closing popup from parent during onload 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 "JS: closing popup from parent during onload" Watch "JS: closing popup from parent during onload" New topic
Author

JS: closing popup from parent during onload

Mike Himstead
Ranch Hand

Joined: Apr 12, 2006
Posts: 178
Hi,

I'd like to close a popup from the parent window after the parent window does a submit. Because of several constraints I'd like to do this in the parent's onload functions. Well, my implementations doesn't work and I'd like to get some input from your:

the parent contains:


openMyWindow is called from a button.

The popup contains:



exitForm is called as a button's onclick fuction. My problem is that after returning to the parent, the searchWindow is null, so it seems as if the global variable is lost somehow. Any idea what's wrong? I'm staring at this for hours but can't find my mistake.

EDIT: added CODE tags
[ July 08, 2008: Message edited by: Mike Himstead ]
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60053
    
  65

Please be sure to use UBB code tags when posting code to the forums. Unformatted code is extremely hard to read and many people that might be able to help you will just move along. Please read this for more information.

You can go back and change your post to add code tags by clicking the .


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
If you submit the parent, you destroy the window object that holds the reference to the pop up window. Therefore when the parent reloads, it can not create the reference back to the child.

Eric
Mike Himstead
Ranch Hand

Joined: Apr 12, 2006
Posts: 178
Duh, I thought I put it in CODE tags, sorry for that, I added them now.

Thanks for the answer, that's it.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JS: closing popup from parent during onload
 
Similar Threads
post forms and window.reload()
Close main window from popup window
Popup Question
Communicate from a Popup Window back to the Parent Window
Check if popup window is already open from parent window?