[Project_owners] Getting document from dialog close onunload

Jed jedbro at gmx.net
Fri Feb 25 17:48:29 EST 2005

You could use Window Mediator and get the last browser, then get the 
element... but I think it would be easier to do the following;

In your dialog do something like this 
onClose="window.opener.setTimeout('myFunction()', 10)"

This will call "myFunction()" once the window is closed after 10ms 
(almost instantly) and in myFunction() do the updateing of the elements.
That's probably the easiest and most elegant way I can think of.


Bradley Rintoul wrote:

> After a dialog box is closed, I'm trying to take a pref set by the 
> dialog and change a toolbar's textbox background color accordingly.  I 
> have a function set as a handler for the "onunload" event, but I can't 
> figure out how to get ahold of the toolbar's textbox...(the toolbar 
> lives in the browser)  I put document.getElementById in the onunload 
> handler, but I think it's still referring to the dialog's DOM...  How 
> do I get ahold of the "browers" DOM document so that I can get the 
> textbox in question...?
> Thanks,
> B. Rintoul
> _______________________________________________
> Project_owners mailing list
> Project_owners at mozdev.org
> http://mozdev.org/mailman/listinfo/project_owners

More information about the Project_owners mailing list