Closing Child window from parent window

Discussion in 'Javascript' started by gokul, Nov 27, 2003.

  1. gokul

    gokul Guest

    Hi all,
    Iam using mozilla firebird.
    I have three popups displayed at one point of time...if I close one
    the other two goes hidden....could you please suggest me the reason
    for this behaviour and how to overcome it.....

    While I opened......these child windows(popup)...from the main window
    I have given "dependent=yes" in the window.open statement.

    The sameway I want to close the Child windows opened from the parent
    window using IE. I use IE 6.0.

    All your suggestions are welcome.
    TIA.
    Regards
    Gokul
     
    gokul, Nov 27, 2003
    #1
    1. Advertising

  2. gokul

    lallous Guest

    How are you creating these windows?
    win1 = window.open(...)
    win2 = window.open(...)
    win3 = window.open(...)

    Then you close say one as: win2.close() ?

    Don't know about the 'dependent' flag, try removing and see too.

    Regards,
    Elias
    "gokul" <> wrote in message
    news:...
    > Hi all,
    > Iam using mozilla firebird.
    > I have three popups displayed at one point of time...if I close one
    > the other two goes hidden....could you please suggest me the reason
    > for this behaviour and how to overcome it.....
    >
    > While I opened......these child windows(popup)...from the main window
    > I have given "dependent=yes" in the window.open statement.
    >
    > The sameway I want to close the Child windows opened from the parent
    > window using IE. I use IE 6.0.
    >
    > All your suggestions are welcome.
    > TIA.
    > Regards
    > Gokul
     
    lallous, Nov 28, 2003
    #2
    1. Advertising

  3. gokul

    gokul Guest

    Dear Lallous,
    Thank you for the Suggestion.But Iam unable to get the job done.
    because its unable to find the object.
    This is how I use the method in my parent window to create popup.
    <a href="#" onclick="javascript:popup('http:\\localhost')">Open
    Window</a>
    as shown above from 2 to 3 pages I open these popups....
    I use a js file by name popup.js which has the code:
    function popup(sUrl)
    {
    popWin= window.open(sUrl, 'taxp_WFaq',
    'dependent=yes,height=340,width=550,left=160,top=130, scrollbars=yes,
    resizable=yes');
    popWin.unload="javascript:WinMaximize()";
    popWin.focus();
    childVal = popWin ;
    return;
    }

    The above is the exact scenario.

    TIA,
    Gokul Raja Dhamodaran.
    "lallous" <> wrote in message news:<bq78fu$1vt4pk$-berlin.de>...
    > How are you creating these windows?
    > win1 = window.open(...)
    > win2 = window.open(...)
    > win3 = window.open(...)
    >
    > Then you close say one as: win2.close() ?
    >
    > Don't know about the 'dependent' flag, try removing and see too.
    >
    > Regards,
    > Elias
    > "gokul" <> wrote in message
    > news:...
    > > Hi all,
    > > Iam using mozilla firebird.
    > > I have three popups displayed at one point of time...if I close one
    > > the other two goes hidden....could you please suggest me the reason
    > > for this behaviour and how to overcome it.....
    > >
    > > While I opened......these child windows(popup)...from the main window
    > > I have given "dependent=yes" in the window.open statement.
    > >
    > > The sameway I want to close the Child windows opened from the parent
    > > window using IE. I use IE 6.0.
    > >
    > > All your suggestions are welcome.
    > > TIA.
    > > Regards
    > > Gokul
     
    gokul, Nov 28, 2003
    #3
  4. gokul

    Grant Wagner Guest

    gokul wrote:

    > Dear Lallous,
    > Thank you for the Suggestion.But Iam unable to get the job done.
    > because its unable to find the object.
    > This is how I use the method in my parent window to create popup.
    > <a href="#" onclick="javascript:popup('http:\\localhost')">Open


    javascript: is not required here, and you should probably be returning false to the event handler to
    ensure the HREF is not followed:

    <a href="#" onclick="popup('http:\\localhost');return false;">Open

    > Window</a>
    > as shown above from 2 to 3 pages I open these popups....
    > I use a js file by name popup.js which has the code:
    > function popup(sUrl)
    > {
    > popWin= window.open(sUrl, 'taxp_WFaq',
    > 'dependent=yes,height=340,width=550,left=160,top=130, scrollbars=yes,
    > resizable=yes');
    > popWin.unload="javascript:WinMaximize()";


    This is not how you dynamically set an event, and even if it were, there is no "unload" event associated
    with the window object. Perhaps what you are trying to do is:

    popWin.onunload = function() { WinMaximize(); }

    Of course, WinMaximize() has to be defined on the page you are opening, or this will not work. If
    WinMaximize() is defined on the page you are opening *from*, then:

    popWin.onunload = function() { if (opener && opener.WinMaximize) WinMaximize(); }

    may work. Untested.

    > popWin.focus();
    > childVal = popWin ;
    > return;


    return is unnecessary here, the function will return on it's own.

    > }
    >
    > The above is the exact scenario.
    >
    > TIA,
    > Gokul Raja Dhamodaran.


    --
    | Grant Wagner <>

    * Client-side Javascript and Netscape 4 DOM Reference available at:
    * http://devedge.netscape.com/library/manuals/2000/javascript/1.3/reference/frames.html
    * Internet Explorer DOM Reference available at:
    * http://msdn.microsoft.com/workshop/author/dhtml/reference/dhtml_reference_entry.asp
    * Netscape 6/7 DOM Reference available at:
    * http://www.mozilla.org/docs/dom/domref/
    * Tips for upgrading JavaScript for Netscape 7 / Mozilla
    * http://www.mozilla.org/docs/web-developer/upgrade_2.html
     
    Grant Wagner, Dec 2, 2003
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?U2lsZWVzaA==?=
    Replies:
    4
    Views:
    33,925
    =?Utf-8?B?U29sZWwgU29mdHdhcmU=?=
    Oct 14, 2004
  2. =?Utf-8?B?Vk1J?=

    Closing popup window when closing parent window?

    =?Utf-8?B?Vk1J?=, Feb 14, 2007, in forum: ASP .Net
    Replies:
    3
    Views:
    657
    Thomas Hansen
    Feb 15, 2007
  3. JohnE
    Replies:
    0
    Views:
    1,167
    JohnE
    Jan 10, 2010
  4. thomas
    Replies:
    0
    Views:
    230
    thomas
    Oct 23, 2003
  5. Noel Dolan
    Replies:
    0
    Views:
    242
    Noel Dolan
    Jul 18, 2004
Loading...

Share This Page