Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Web Programming > JavaScript > Javascript How-To
|
Javascript How-To Ask your "How do I do this with Javascript?" questions here.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Javascript How-To section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 23rd, 2006, 04:01 PM
Registered User
 
Join Date: Oct 2006
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

We are working with a form which does not have frames/framesets. We use the onunload function. Is there any way that the function is called only on closing the window and not on page refresh?

 
Old October 24th, 2006, 01:14 AM
Authorized User
 
Join Date: May 2006
Posts: 31
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to kaos_frack
Default

you might wanna try 'watching' the window's 'closed' property
something like this:
Code:
window.watch("closed", someFunction());
i never tried it, maybe it works
but why would you log the user off when they close the window
they might have several windows with your site loaded
i'm sure there must be a workaround using sessions or sumtin






Similar Threads
Thread Thread Starter Forum Replies Last Post
delete session when tab window closes bikermike Beginning PHP 2 February 21st, 2009 05:02 PM
on window unload event in javascript. babu17 Classic ASP Basics 1 April 15th, 2006 05:48 AM
How to detect if pop up window is disabled bekim Javascript How-To 1 January 23rd, 2005 06:38 AM
Handling window unload event MurthyGarimella Javascript 2 June 30th, 2004 10:59 AM
How to detect window Close (X) Button cyberjames2003 Javascript How-To 2 July 27th, 2003 08:13 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.