Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - window close script
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

window close script

 Post Reply Post Reply
Author
pedalcars View Drop Down
Senior Member
Senior Member


Joined: 12 August 2002
Location: United Kingdom
Status: Offline
Points: 268
Post Options Post Options   Thanks (0) Thanks(0)   Quote pedalcars Quote  Post ReplyReply Direct Link To This Post Topic: window close script
    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
www.pedalcars.info

The most fun on four wheels

Back to Top
ljamal View Drop Down
Mod Builder Group
Mod Builder Group


Joined: 16 April 2003
Status: Offline
Points: 888
Post Options Post Options   Thanks (0) Thanks(0)   Quote ljamal Quote  Post ReplyReply Direct Link To This Post 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.

Edited by ljamal
Back to Top
MorningZ View Drop Down
Senior Member
Senior Member
Avatar

Joined: 06 May 2002
Location: United States
Status: Offline
Points: 1793
Post Options Post Options   Thanks (0) Thanks(0)   Quote MorningZ Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
pedalcars View Drop Down
Senior Member
Senior Member


Joined: 12 August 2002
Location: United Kingdom
Status: Offline
Points: 268
Post Options Post Options   Thanks (0) Thanks(0)   Quote pedalcars Quote  Post ReplyReply Direct Link To This Post 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.

www.pedalcars.info

The most fun on four wheels

Back to Top
ljamal View Drop Down
Mod Builder Group
Mod Builder Group


Joined: 16 April 2003
Status: Offline
Points: 888
Post Options Post Options   Thanks (0) Thanks(0)   Quote ljamal Quote  Post ReplyReply Direct Link To This Post 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?
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.