Help trying to close popup window
Posted: Mon Dec 29, 2003 11:24 am
I have some php code which generates a popup window while it process data. The problem I am having is trying to close the window automatically when the main page loads. The opening page is in a frame.
The sequence should work like this:
first page opens popup window -> first window loads new page -> new page closes popup window onload
but it does'nt.
this is the code I have being trying.
Any Ideas?
I am rubbish with JS, so any help is appreciated.
The sequence should work like this:
first page opens popup window -> first window loads new page -> new page closes popup window onload
but it does'nt.
this is the code I have being trying.
Code: Select all
// first page
<SCRIPT LANGUAGE="JavaScript">
window.open("process_data.html", 'newWin',
'width= 200px, height=100px, toolbar = no, status = no,
scrollbars = yes, resizable = yes');
window.close();
</SCRIPT></p>
//secondpage
<head>
<script>
function closeWin(newWin) {
newWin.close();
}
</script>
</head>
<body bgcolor="#dddddd" leftmargin="0" marginheight="0"
marginwidth="0" topmargin="0" onLoad="closeWin();">Any Ideas?
I am rubbish with JS, so any help is appreciated.