Print Page | Close Window

window close script

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: Classic ASP Discussion
Forum Description: Discussion on Active Server Pages (Classic ASP).
URL: https://forums.webwiz.net/forum_posts.asp?TID=4138
Printed Date: 30 March 2026 at 10:06am
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: window close script
Posted By: pedalcars
Subject: window close script
Date Posted: 08 July 2003 at 2:36pm
I'm after a script that will close the browser window without the browser asking the user if it's OK for the page to close itself.

It's for an admin login page, whereby if the wrong username / password is entered a certain number of times (ie, a hack attempt), the window will close. Obviously I can use window.close() or self.close(), but IE pops up a warning first and allows you to prevent the self-closure.

Don't mind if it's ASP or javascript.

Ta


-------------
http://www.pedalcars.info/ - www.pedalcars.info

The most fun on four wheels




Replies:
Posted By: ljamal
Date Posted: 08 July 2003 at 4:00pm
The warning only pops up if you are in the parent window. If you are in a child window that was spawned by a parent, then you will not get a pop up. To my knowledge, Javascript is the only method for closing the browser.

-------------
L. Jamal Walton

http://www.ljamal.com/" rel="nofollow - L. Jamal Inc : Web/ Print Design and ASP Programming


Posted By: MorningZ
Date Posted: 08 July 2003 at 4:40pm
i'll back up to what ljamal is saying, javascript (and this is your ONLY method of closing a window) will not "quietly" close a parent window.....

-------------
Contribute to the working anarchy we fondly call the Internet


Posted By: pedalcars
Date Posted: 08 July 2003 at 4:58pm
Thanks both. I have just found elsewhere a nice cheat for this - you still get the js warning, the only difference being you add a couple of lines to define what it says and does - so regardless of whether you click "OK" or "cancel", the window still closes.

Haven't tested it fully yet, but I haven't found a way around it yet.



-------------
http://www.pedalcars.info/ - www.pedalcars.info

The most fun on four wheels



Posted By: ljamal
Date Posted: 08 July 2003 at 5:18pm
Originally posted by pedalcars pedalcars wrote:

you still get the js warning, the only difference being you add a couple of lines to define what it says and does - so regardless of whether you click "OK" or "cancel", the window still closes.


That's the same cheat that porn and less moral web sites use to reset your search option or add them selves as your home page. Are you sure that's what you want to be grouped with? Why is it so important to close the window?

-------------
L. Jamal Walton

http://www.ljamal.com/" rel="nofollow - L. Jamal Inc : Web/ Print Design and ASP Programming



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net