Close popup from next page

Discussion in 'Javascript' started by Sjaakie Helderhorst, Jan 21, 2004.

  1. Hi,
    I wrote an ASP-page which allows friends to upload a datafile which will be
    processed and stored in a database. Because large files take some time to
    process I want to open a popup 'Please wait, processing' with some fancy
    graphics. So, onSubmit -> check form and open popup if correct.
    When data is written into the database (and summary page has finished
    loading) I want to close the popup.... although I named it winDialog
    (winDialog = window.open(...)) the new page tells me it can't find this
    popup ( if (window.winDialog) { winDialog.close() } ). Can anyone tell me
    what's wrong? Maybe I'm doing things wrong. Or could you perhaps put me in a
    right direction...

    Thanks!
     
    Sjaakie Helderhorst, Jan 21, 2004
    #1
    1. Advertising

  2. "Sjaakie Helderhorst" <> wrote in message
    news:400e7b10$0$327$4all.nl...
    <snip>
    >... the new page tells me it can't find this
    >popup ( if (window.winDialog) { winDialog.close() } )...

    <snip>

    When the page in a window (or frame) is changed everything from that
    window (or frame) is destroyed. Including all JavaScript functions and
    local variables. So window.winDialog does not exist on the new page
    unless (or until) you create it. References to external objects within a
    window (or frame) cannot survive the changing of the contents of that
    window (or frame).

    But pop-ups are so unreliable anyway that there is probably no point in
    putting any significant effort into working round that restriction.
    Probably better to display a (DHTML) notification in the page with the
    form and let the arrival of the replacing page remove that.

    Richard.
     
    Richard Cornford, Jan 21, 2004
    #2
    1. Advertising

  3. It's a rather unorthodox way of doing things, but it works (WOOHOO!) ... and
    that's what counts for me :)
    Thanks for the quick response!

    Sjaakie

    "Brynn" <> schreef in bericht
    news:...
    > I was just testing within one page ... the main thing is you have to
    > opwn the window again on the second page, and immediately close it
    >
    > Brynn
    > www.coolpier.com
    >
    > On Wed, 21 Jan 2004 14:12:46 +0100, "Sjaakie Helderhorst"
    > <> wrote:
    >
    > >Hi,
    > >I wrote an ASP-page which allows friends to upload a datafile which will

    be
    > >processed and stored in a database. Because large files take some time to
    > >process I want to open a popup 'Please wait, processing' with some fancy
    > >graphics. So, onSubmit -> check form and open popup if correct.
    > >When data is written into the database (and summary page has finished
    > >loading) I want to close the popup.... although I named it winDialog
    > >(winDialog = window.open(...)) the new page tells me it can't find this
    > >popup ( if (window.winDialog) { winDialog.close() } ). Can anyone tell me
    > >what's wrong? Maybe I'm doing things wrong. Or could you perhaps put me

    in a
    > >right direction...
    > >
    > >Thanks!
    > >
    > >

    >
    > Brynn
    > www.coolpier.com
    >
    > I participate in the group to help give examples of code.
    > I do not guarantee the effects of any code posted.
    > Test all code before use!
     
    Sjaakie Helderhorst, Jan 21, 2004
    #3
  4. Sjaakie Helderhorst

    Brynn Guest

    The only lines of code that matter there are

    MyWindow=window.open('','MyWindow','');
    MyWindow.close();

    I just posted the entire test page I was using.

    you have to create the object again (which will replace the old) so
    that the page knows what object you are talking about.

    ....glad it works for ya =)

    Brynn
    www.coolpier.com



    On Wed, 21 Jan 2004 15:53:52 +0100, "Sjaakie Helderhorst"
    <> wrote:

    >It's a rather unorthodox way of doing things, but it works (WOOHOO!) ... and
    >that's what counts for me :)
    >Thanks for the quick response!
    >
    >Sjaakie
    >
    >"Brynn" <> schreef in bericht
    >news:...
    >> I was just testing within one page ... the main thing is you have to
    >> opwn the window again on the second page, and immediately close it
    >>
    >> Brynn
    >> www.coolpier.com
    >>
    >> On Wed, 21 Jan 2004 14:12:46 +0100, "Sjaakie Helderhorst"
    >> <> wrote:
    >>
    >> >Hi,
    >> >I wrote an ASP-page which allows friends to upload a datafile which will

    >be
    >> >processed and stored in a database. Because large files take some time to
    >> >process I want to open a popup 'Please wait, processing' with some fancy
    >> >graphics. So, onSubmit -> check form and open popup if correct.
    >> >When data is written into the database (and summary page has finished
    >> >loading) I want to close the popup.... although I named it winDialog
    >> >(winDialog = window.open(...)) the new page tells me it can't find this
    >> >popup ( if (window.winDialog) { winDialog.close() } ). Can anyone tell me
    >> >what's wrong? Maybe I'm doing things wrong. Or could you perhaps put me

    >in a
    >> >right direction...
    >> >
    >> >Thanks!
    >> >
    >> >

    >>
    >> Brynn
    >> www.coolpier.com
    >>
    >> I participate in the group to help give examples of code.
    >> I do not guarantee the effects of any code posted.
    >> Test all code before use!

    >
    >


    Brynn
    www.coolpier.com

    I participate in the group to help give examples of code.
    I do not guarantee the effects of any code posted.
    Test all code before use!
     
    Brynn, Jan 21, 2004
    #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. Deniz Bahar
    Replies:
    2
    Views:
    490
    Andrey Tarasevich
    Mar 9, 2005
  2. Iñaki Baz Castillo
    Replies:
    7
    Views:
    893
    Iñaki Baz Castillo
    Jan 12, 2010
  3. KS
    Replies:
    4
    Views:
    209
  4. Jens Peter Hansen
    Replies:
    7
    Views:
    559
    Randy Webb
    Jun 19, 2004
  5. Replies:
    2
    Views:
    481
Loading...

Share This Page