473,513 Members | 2,519 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Detecting User Closing Window X button

1 New Member
Hi,
I want call a function when the user trying to close a browser by clicking on close button.
for the above question i used onbeforeunload and onunload functions,these
two functions working when i clicked on close button ,but my prob with onbeforeunload and onunload functions is ,when i tried to change the url then
also the same functions calling so can any one give solution for me

Thanks in advance
Nanajee.
Mar 4 '09 #1
1 1862
acoder
16,027 Recognized Expert Moderator MVP
Unfortunately (of fortunately if you see it differently), it's not possible to determine if the current browser window is closed in a neat, cross-browser way. One or two hacks may work, but they wouldn't be reliable.

One possibility, though, is to use a popup window and from the parent, you could check the window.closed property.
Mar 4 '09 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

2
4313
by: William Gill | last post by:
I am trying to make a simple data editor in Tkinter where each data element has a corresponding Entry widget. I have tried to use the FocusIn/FocusOut events to set a 'hasChanged' flag (if a...
2
1715
by: Asit | last post by:
How can i know when user clicks X button of the browser ? I have to write some code when user clicks X button of browser. What is the event for capturing this event ? Help needed ASAP. Asit
2
2088
by: Kiran | last post by:
Hi all, Can anybody let me know how to detect when my user clicks the X button on the window. I used unload event it did not work(on IE). My web page is a .asp page which reloads itself when...
2
1826
by: Du Dang | last post by:
I tried to implement a feature like msn or yahoo messeger, where the user click the "x" button, the form just hide itself to the tray icon. I got it to work by added the following code to the...
4
9519
by: morc | last post by:
hi, is there any way to refresh the page when the user clicks back button?I have a jsp page that i need to regerenate everything everytime the user visits it. its either that or i want to...
1
1350
by: sowen | last post by:
I am using the ExtensibleDialog to create a dialog for our internal program use. We want the user select some items in our own controls, and then generate the filename to the textbox. But that is...
0
1628
by: gimme_this_gimme_that | last post by:
I have a JSP that renders a XHTML formatted page. The user clicks a button (not a submit) that calls a validate JavaScript function that submits the form. The user clicks and goes to a...
3
4210
by: ghjk | last post by:
I have a web page which is used to enter user data. In there I have 4 buttons named as "Submit, Confirm,Edit,Cancel". User should enter data and click "Submit " button. Then I want to display all...
10
8776
by: visweswaran2830 | last post by:
I want to cal window button using sendkeys.send() method. I have tried with sendkeys.send("{WIN}") and sendkeys.send("{Lwin}"). but not working.. Can you help me
0
7260
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7160
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7384
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7537
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
7525
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
5086
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4746
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3233
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3222
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.