aspose file tools
The moose likes HTML, CSS and JavaScript and the fly likes How to do some operation while closing a window? Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of Practical Unit Testing with TestNG and Mockito this week in the Testing forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Reply Bookmark "How to do some operation while closing a window?" Watch "How to do some operation while closing a window?" New topic
Author

How to do some operation while closing a window?

Venkatesh Rajendran
Ranch Hand

Joined: May 17, 2001
Posts: 59
Hi,
I would like to do some operation while closing a window. I tried onUnload, it gives me some other problem, so is there any other way to do it? If so please pass on to me.
Thanks in advance.
Regards,
Venkat
Yuriy Fuksenko
Ranch Hand

Joined: Feb 02, 2001
Posts: 411
Well, onunload the only cross-browser way, that you have.
in IE there is also "onbeforeunload", but that pretty mach it.
what problems onuload gave you?
Venkatesh Rajendran
Ranch Hand

Joined: May 17, 2001
Posts: 59
Hi,
Thanks for your reply. Now it is working fine.
Actually onUnload I am deleting some session values, so after completion of my some DB update, I am showing Success page, when I used onUnload success page was not showing and DB update was also not done.
Thanks & Regards,
Venkat
 
 
subject: How to do some operation while closing a window?
 
Threads others viewed
Dispose Window & jar
Detecting the window close in IE
Modal window and its side-effects
window icon menu behaviour
Deleting all the cookies by means of a javascript function
Two Laptop Bag