Here's some simple code that illustrates my problem.
On the first page I just "Click here" to go to the pop-up window.
Pop-up window code
Pop-up window code. At the bottom of the window the user clicks the "Close Window" button and the window closes (see function test_popup().
The problem is that after the window closes, I would like to be back on the page where I called the pop-up window. Instead a blank page is open corresponding to the second page and the initial page has disappeared.
Is there a way to get back to the starting point and eliminate the blank page?
Thanks for any help you can offer.
On the first page I just "Click here" to go to the pop-up window.
Code:
<html>
<head>
<title>Initial Page</title>
</head>
<body>
<p><a href="test-initial.html">Click Here</a></p>
</body>
</html>
Pop-up window code
Code:
<html>
<HEAD>
<SCRIPT LANGUAGE="JavaScript">
function xpopUp(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=600,height=450,left = 100,top = 50');");
}
getURL = "test.html";
xpopUp(getURL);
</script>
<title>test</title>
</head>
<body>
</body>
</html>
Pop-up window code. At the bottom of the window the user clicks the "Close Window" button and the window closes (see function test_popup().
Code:
<html>
<head>
<title>Pop-Up Window</title>
<style fprolloverstyle>A:hover {color: #FF0000}
</style>
<script language="javaScript">
function test_popup(){
window.close();
}
</script>
</head>
<body bgcolor="#FFCC00">
<table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="579" height="261" bgcolor="#D0DDA8">
<tr>
<td width="174" height="101">
<p align="center">
</td>
<td width="402" height="101">
<p align="center"><b><font face="Arial" size="4" color="#FF0000">Test Pop Up
Page<br>
</font></b></td>
</tr>
<tr>
<td width="174" height="203" bgcolor="#FFFFCC">
<p class="MsoBodyText" style="margin-left: 9; margin-right: 9" align="center">
</td>
<td width="402" height="203" bgcolor="#FFFFCC">
<p style="margin-left: 15; margin-right: 15" align="justify">
</td>
</tr>
</table>
<br>
<center><BUTTON onClick=test_popup()>Close Window</BUTTON></center>
<br>
</body>
</html>
The problem is that after the window closes, I would like to be back on the page where I called the pop-up window. Instead a blank page is open corresponding to the second page and the initial page has disappeared.
Is there a way to get back to the starting point and eliminate the blank page?
Thanks for any help you can offer.