Javascript Close Function
Posted: Sun Oct 19, 2003 2:08 am
Hi All,
I am using the below file (Test.php) as my first page which has a link and navigate to Test2.php when click on the link.
[Test.php]
<SCRIPT LANGUAGE="JavaScript">
function openBar(){
window2=open('showprog.php', 'Show_Progress', 'location=no,scrollbars=no,menubar=no,toolbar=no,status=no,resizable=no,top=240,left=250,height=30,width=300');
}
</SCRIPT>
<a href='Test2.php' onClick="javascript:openBar();"> Testing</strong></a>
<!--end-->
When I click on the link, it leads me to Test2.php and meanwhile it popup a new window called 'window2'.
In Test2.php, a code is used to close the 'window2' during the page is loading (Please refer to below). However, it shows an error message stated that 'window2 is undefined'. May I know what is the error in the code?
[Test2.php]
<html>
<head>
</head>
<body onLoad="javascript:window2.close();">
</body>
</html>
<!--end-->
Please help.
Thanks in advance.
Regards,
Desmond.
I am using the below file (Test.php) as my first page which has a link and navigate to Test2.php when click on the link.
[Test.php]
<SCRIPT LANGUAGE="JavaScript">
function openBar(){
window2=open('showprog.php', 'Show_Progress', 'location=no,scrollbars=no,menubar=no,toolbar=no,status=no,resizable=no,top=240,left=250,height=30,width=300');
}
</SCRIPT>
<a href='Test2.php' onClick="javascript:openBar();"> Testing</strong></a>
<!--end-->
When I click on the link, it leads me to Test2.php and meanwhile it popup a new window called 'window2'.
In Test2.php, a code is used to close the 'window2' during the page is loading (Please refer to below). However, it shows an error message stated that 'window2 is undefined'. May I know what is the error in the code?
[Test2.php]
<html>
<head>
</head>
<body onLoad="javascript:window2.close();">
</body>
</html>
<!--end-->
Please help.
Thanks in advance.
Regards,
Desmond.