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

Home Posts Topics Members FAQ

Trap when a window is closed

dmjpro
2,476 Top Contributor
When I did VC++ then I learned that the window onclose function can be overidden.
But is it possible in js to trap when I close a window.
I need the immediate help?
Jan 27 '07 #1
3 1300
acoder
16,027 Recognized Expert Moderator MVP
You can use
Expand|Select|Wrap|Line Numbers
  1. window.onbeforeunload = ...
I'm not sure how well it is supported.
Jan 27 '07 #2
dmjpro
2,476 Top Contributor
I want to override the default behaviour of window close.
I want to customize the window close event.
I want to stop window to close when user intends to close it.
I want some clean up operations before closing the window.
Jan 30 '07 #3
acoder
16,027 Recognized Expert Moderator MVP
You can use:
Expand|Select|Wrap|Line Numbers
  1. window.onbeforeunload=function() {...
or call your function. You can code your function to ask for confirmation, etc.
Jan 30 '07 #4

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

Similar topics

5
4407
by: Matt Kruse | last post by:
See: http://www.mattkruse.com/temp/window_closed.html It looks like the .closed property of a window is inaccessible if the window is actually closed. Other browsers have no problem detecting...
3
2485
by: Kiki | last post by:
Hello, i wonder if anyone can help.. Is there a way of knowing from the parent window (var window;) that the child window (var newWindow) has been closed? i can't touch the child window's closed...
10
9762
by: Tom Szabo | last post by:
Is there an event when that triggers when the window is closing.... I am talking about when the user clicks on the cross on the right top corner of the window!!!
5
73179
by: RAJ | last post by:
hi plz tell me how to know "how window is going to close"... i have to right code for X button of forms... plz telll me thanks bye
1
3205
by: Sean Nolan | last post by:
We have implemented unhandled error trapping at the application level and log these errors to our database. One error, however, the does not get trapped is when the connection pool has exceeded the...
9
4890
by: tshad | last post by:
This is from my previous post, but a different issue. I have the following Javascript routine that opens a popup page, but doesn't seem to work if called from an asp.net button. It seems to work...
21
18113
by: alistair_henderson | last post by:
Morning All, I have some code for a website which uses 'window.open' to simulate modal dialog boxes. I use the window.closed property to decide if the window object exists at various points. ...
10
10017
by: morangolds | last post by:
Hi, I've been having a problem with C++ Windows Forms apps not "ending" when you close the form window. I've searched about this problem all over the place and most searches have lead me to...
14
2086
by: =?Utf-8?B?UGF1bA==?= | last post by:
Hi I tried a google search but could not find anything. I am trying to cause one webpage to reload when a second web page is closed. The second webpage loads data into a session variable and when...
0
7166
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
7543
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
7534
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
5094
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
4749
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
3226
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1601
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
805
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
459
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.