I
Iver Erling Årva
I have an application that uses a window.open() to open it's own main window
where all my programs takes place. I use a timeout so if nothing goes on for
15 minutes the document below is called. To log in again all the users have
to do is to click the link in the lower part of the window. This causes the
login window to show up again. The problem arise if the window that opened
this window has been closed in the meantime. To deal with this and avoid the
top.window.opener is null or not an object error I made the startLogin
function. When the original top window has been closed the alert shows up
fine and thereby indicates that the program has reached that far, but the
document.location stuff doesn't work. Nothing happens. As you can see, I've
tried several different versions (and others too), but none of them seem to
work. Can anyone tell me what I'm doing wrong?
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Logged Out</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="Styles/StylesMenu.css" rel="stylesheet" type="text/css">
<script type=text/javascript>
function startLogin(){
if (top.window.opener){
top.window.opener.location="Default.htm";
top.window.close();
}
else {
alert("It get's to this point and then nothing more happens!");
self.document.location="Default.htm";
self.document.location.href("Default.htm");
document.location="Default.htm";
location="Default.htm";
}
}
</script>
</head>
<body onload="javascript:window.status='The system logged you out!'">
<form>
<table align="center" border="0">
<tr>
<td><div align="center"><img border="6" src="images/Trwww2.gif"
ALIGN="MIDDLE"></div>
</td>
</tr>
</table>
<h1 align="center">You are logged out!</h1>
</p>
<div align="center"><font size="2"><a href="javascript:void(0);"
onclick="startLogin();">Log in again</a></font></div>
</form>
</body>
</html>
Thanks for any help!
(e-mail address removed)
where all my programs takes place. I use a timeout so if nothing goes on for
15 minutes the document below is called. To log in again all the users have
to do is to click the link in the lower part of the window. This causes the
login window to show up again. The problem arise if the window that opened
this window has been closed in the meantime. To deal with this and avoid the
top.window.opener is null or not an object error I made the startLogin
function. When the original top window has been closed the alert shows up
fine and thereby indicates that the program has reached that far, but the
document.location stuff doesn't work. Nothing happens. As you can see, I've
tried several different versions (and others too), but none of them seem to
work. Can anyone tell me what I'm doing wrong?
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Logged Out</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="Styles/StylesMenu.css" rel="stylesheet" type="text/css">
<script type=text/javascript>
function startLogin(){
if (top.window.opener){
top.window.opener.location="Default.htm";
top.window.close();
}
else {
alert("It get's to this point and then nothing more happens!");
self.document.location="Default.htm";
self.document.location.href("Default.htm");
document.location="Default.htm";
location="Default.htm";
}
}
</script>
</head>
<body onload="javascript:window.status='The system logged you out!'">
<form>
<table align="center" border="0">
<tr>
<td><div align="center"><img border="6" src="images/Trwww2.gif"
ALIGN="MIDDLE"></div>
</td>
</tr>
</table>
<h1 align="center">You are logged out!</h1>
</p>
<div align="center"><font size="2"><a href="javascript:void(0);"
onclick="startLogin();">Log in again</a></font></div>
</form>
</body>
</html>
Thanks for any help!
(e-mail address removed)