We want to have it so when a HTML form is submitted (a person is uploading a picture) that a Javascript will open a pop up window and then automatically close the window once the file is sent sucessfully.
See, we use like it's w = window.open(blah blah to open and w.close() to close but when the form is submitted w gets destroyed, so we need a way to close it without w or pass w to the next page or need a way for the popup to check when form is done submitting so it can close itself
Does anyone know a good way to do this?
Thanks
help: How to auto close pop up when finished.
Moderator: General Moderators
-
camarosource
- Forum Commoner
- Posts: 77
- Joined: Sat Aug 03, 2002 10:43 pm
In the document which will be opened in that pop-up window. You should put the following line:
If I catch what you're up to. 
Code: Select all
<body onLoad="window.close();">A reminder, that you can pass variables using $_GET (http://example.com/page.php?something=here) also, that later can be inserted into javascript. Might be useful.
- Vincent Puglia
- Forum Commoner
- Posts: 67
- Joined: Thu Sep 04, 2003 4:20 pm
- Location: where the World once stood
Hi,
Sorry, I didn't fully understand the problem this morning in the other forum.
in the original page:
w = window.open('w.html');
location='x2.html'
in the x2 page:
nothing relevant to the problem
in the w document:
function doit()
{
if (opener.location.toString().indexOf('x2.html') != -1) this.close();
setTimeout('doit()', 1000);
}
setTimeout('doit()', 1000)
Vinny
Sorry, I didn't fully understand the problem this morning in the other forum.
in the original page:
w = window.open('w.html');
location='x2.html'
in the x2 page:
nothing relevant to the problem
in the w document:
function doit()
{
if (opener.location.toString().indexOf('x2.html') != -1) this.close();
setTimeout('doit()', 1000);
}
setTimeout('doit()', 1000)
Vinny