View Full Version : Closing window
Reuben_Meyer
08-14-2002, 07:22 AM
HI
I need to close a window without the user being asked :
The web page you are viewing is trying to close the window.
Do you want to close the window?
The window that I am trying to close invokes a new full screen
window, and it is annoying if the user is bothered with the
window opening it.
this is not for a web page but a internal web based program I am
busy writing.
Can you help Plz?
:confused:
glenngv
08-14-2002, 07:30 AM
window.opener = top;
window.close();
Reuben_Meyer
08-14-2002, 10:00 AM
Originally posted by glenngv
window.opener = top;
window.close();
This does not work if the current window is the parent window, If I called this window from another window this would work.
Thus it is still giving me that confirmation window :
The Web page you are viewing is trying to close the window.
Do you want to close the window?
And this is the message I am trying to avoid.
Regards Reuben.
glenngv
08-14-2002, 10:09 AM
this should work in some browsers because it is a known bug.
what browser are you using? in the site where i found it, it lists the supported browsers. just forgot the url.
Reuben_Meyer
08-14-2002, 10:25 AM
Originally posted by glenngv
this should work in some browsers because it is a known bug.
what browser are you using? in the site where i found it, it lists the supported browsers. just forgot the url.
I am using Internet Explorer 5.5.
piniyini
08-14-2002, 12:14 PM
I just tried this script & it works
<script><!--
window.setTimeout("javascript:top.window.close();",5000)
/--></script>
but I'm not sure if It'll work for your "internal web based program". You can try.
MAXIMUS
08-14-2002, 02:27 PM
window.opener = top;
window.close();
... this will work in IE 5.5 for your parent window, just put it at the bottom of your pop-up function. Did it just yesterday and worked fine.
glenngv
08-15-2002, 03:53 AM
mine is also IE5.5 and it works.
can you post the whole code?
Originally posted by Reuben_Meyer
I am using Internet Explorer 5.5.
Reuben_Meyer
08-19-2002, 11:29 AM
Originally posted by glenngv
mine is also IE5.5 and it works.
can you post the whole code?
Sorry I took so long to reply.
My code is as follows :
<html>
<head>
<script language="javascript">
<!-- Begin
function start()
{
var _loc = "login.jsp";
var _name= "Login";
var _features="fullscreen";
var _replace=true;
window.open(_loc,_name,_features,_replace);
window.opener = top;
window.close();
}
//end-->
</script>
</head>
<body onload="javascript:start()">
</body>
</html>
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.