Re: executing a JS function when a browser closes

by "Michael Caton" <creativesolution(at)inficad.com>

 Date:  Tue, 11 Apr 2000 14:59:16 -0700
 To:  "Rajnish Bhaskar" <9705228b(at)student.gla.ac.uk>,
<hwg-basics(at)hwg.org>
 References:  localhost
  todo: View Thread, Original
Try this:

<body bgcolor="#FFFFFF" onUnload="Function(document.name)">

where Function is function name and (document.name) should reflect the form
name (e.g. document.form1)

I am not sure if this will work if you have more than one form on a
page...hmm let me know it this works..


Michael Caton
Student Technology Assistant
Center for Teaching and Learning
Mesa Community College
----- Original Message -----
From: "Rajnish Bhaskar" <9705228b(at)student.gla.ac.uk>
To: <hwg-basics(at)mail.hwg.org>
Sent: Tuesday, April 11, 2000 1:51 PM
Subject: executing a JS function when a browser closes


> Hi all,
> I was just wondering, is it possible to have a Javascript function
> executed just before a broswer closes?  What I have is a situation where
> people will be logging on to a site, and I want them to be logged out,
> even if they forget to press the logout button, ie when the close the
> browser.  Is this possible?
>
> Thanks,
> Raj.
> ------------------------------------------------------------------
> __        __
> |   | |   |   Rajnish Bhaskar, University of Glasgow
> |_ / |_ /   E-Mail: rajy(at)i.am
> |   \ |   \   Home Page: http://i.am/rajy
> |    \ |__/
> Sometimes it's better to light a flamethrower than curse the darkness.
>         -- (Terry Pratchett, Men At Arms)
>
>

HTML: hwg-basics mailing list archives, maintained by Webmasters @ IWA