|
|
 |
Re: FN-FORUM: testing when a window is closed
date posted 7th May 2006 20:05
On 7 May 2006, at 18:27, [EMAIL REMOVED] wrote:
> Hi,
> I want to call some Javascript when someone leaves a page or
> closes the
> Browser. OnUnload does both in Firefox but it doesn't work in Ie when
> someone closes a Window only when they go to a differenrent page or
> reloads.
> How can I do the call in IE when someone closes the Browser? I can't
> find
> anything helpful in Google.
Hi Pam,
I use something like this: Seems to work okay in IE
function callLogoutScript(){
if (document.all){
if ((window.event.clientX < 0) && (window.event.clientY < 0)) {
// if the user clicks the close box to close the window
//call the logout page in a new window
window.open('logout.php', 'logOut', "");
}
}
}
Call it from the body tag like this:
Best regards,
Ray
------------------------------
Ray McGinty Information Design
Specialising in web application development,
e-commerce and design for print.
http://www.rmid.co.uk
Listed on the National Business Link Consultants Register
|
 |
|