Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

automatic close window without warning message from browser

Status
Not open for further replies.

206

Programmer
Mar 9, 2004
1
IN
Hi all,

I am writing a script that will automatic close the window after 5 seconds. However, before the window close, a warning message from BROWSER come out asking me if i really want to close the window. This happens in both IE and Netscape.

How can I prevent that promting message come out?

p.s. Usually this doesn't happen if the window is a pop-up. However I don't want to make it as a pop-up now.

Thanks!

<head>
<script language=&quot;javascript&quot;>
<!--
var timer = null;
//-->
</script>
</head>
<body onLoad=&quot;timer=setTimeout('parent.window.close()',5000)&quot;>
This window will close after 5 seconds
</body>
 
There is no way to do that with standard Javascript. Think about it: it would be very frustrating if any website out there could close your browser window without asking you. But the browsers traditionally allow windows that have been opened by Javascript to be closed without prompting.

The only way to close a window without a prompt would be with some sort of &quot;signed script&quot;, where the user is asked ahead of time whether to allow the script more priviledges. Otherwise, no go... sorry.
 
i'm very frustrating: (& not me alone..)
thread216-75797

but remember, you can allways turn aX off.. Victor
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top