Article View: microsoft.public.inetsdk.programming.scripting.jscript
Article #33Re: Does "onwindowclose.event" exist?
From: Scott A. Hightower
Date: Thu, 21 Oct 1999 00:00
Date: Thu, 21 Oct 1999 00:00
46 lines
3037 bytes
3037 bytes
Actually, I avoid trying to do anything extensive or critical upon closure of a window, whether browser or application. I consider it a usability irritant, since the user may be trying to shut down their system, or in the middle of an emergency. Whenever possible, do as much of your cleanup/logout/pre-logout as you can along the way, and also design your application to come back up in a sane useful state if it was shut down suddenly, say due to a system crash or lockup. (I've heard those happen every once in awhile...) That said, yes, onunload is not reliable. If you think you will usually or often have to display a logout window, bring it up beforehand, but keep the focus on the main window. If the user does an orderly logout from the main window, close the other one. If they just close the main window, the logout window is there to finish the job. Ben Carter wrote: > I don't believe onunload() is reliable enough, it won't be able to load > a page before it actually unloads. > In IE there is the event onbeforeunload(), which is what you want. > Unfortunately, this has no equivalent in NS. > > Rafael Rasinger wrote: > > > > Dear reader! > > > > I am looking for an "onwindowclose" event in JS. > > > > Saying: If a user wants to close the Browser window a JS function is > > launched (in my case a loggout page is loaded) before the browser is closed. > > Is there a posibility of performing this feature (in NN and MSIE)? > > > > Thanx for ur help, Rafael > > -- > //////////////////O\\\\\\\\\\\\\\\\\\ > //// \\\\ > /// Ben S. Carter, \\\ > // Web Application Developer, \\ > / Bluewater Parklands Mgmt. Inc. \ > > Guelph, ON, N1H 3G3 < > \ 519-766-0901 Ext. 226 / > \\ ben@camis.com // > \\\ webmaster@camis.com /// > \\\\ //// > \\\\\\\\\\\\\\\\\\O//////////////////
Technical Details
Message-ID:
<380F2732.61D6BBA4@lex.infi.net>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<380d7254@news.kapsch.co.at> <380DE26E.C264F3BF@camis.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10d4a5,5cb9f8b118bebff7 X-Google-Attributes: gid10d4a5,public X-Google-Thread: 10731d,5cb9f8b118bebff7 X-Google-Attributes: gid10731d,public X-Google-Thread: fb3cb,5cb9f8b118bebff7 X-Google-Attributes: gidfb3cb,public X-Google-Thread: 10c71c,5cb9f8b118bebff7 X-Google-Attributes: gid10c71c,public X-Google-Thread: fcc66,5cb9f8b118bebff7 X-Google-Attributes: gidfcc66,public From: "Scott A. Hightower" <hightowr@lex.infi.net> Subject: Re: Does "onwindowclose.event" exist? Date: 1999/10/21 Message-ID: <380F2732.61D6BBA4@lex.infi.net> X-Deja-AN: 538868338 Content-Transfer-Encoding: 7bit References: <380d7254@news.kapsch.co.at> <380DE26E.C264F3BF@camis.com> X-Accept-Language: en Content-Type: text/plain; charset=us-ascii Organization: Another Netscape Collabra Server User Mime-Version: 1.0 Newsgroups: microsoft.public.inetsdk.programming.scripting.jscript,microsoft.public.scripting.jscript,borland.public.intrabuilder.javascript,comp.lang.javascript,de.comp.lang.javascript