Close popup from next page

  • Thread starter Sjaakie Helderhorst
  • Start date
S

Sjaakie Helderhorst

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!
 
R

Richard Cornford

... 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.
 
S

Sjaakie Helderhorst

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
 
B

Brynn

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



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
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!
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,534
Members
45,007
Latest member
OrderFitnessKetoCapsules

Latest Threads

Top