aspose file tools*
The moose likes HTML, CSS and JavaScript and the fly likes Javascript function Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Javascript function" Watch "Javascript function" New topic
Author

Javascript function

Mark Butcher
Ranch Hand

Joined: Jun 28, 2012
Posts: 46
Hi everybody,

I want to invoke a javascript function just before a browser window is closed.
That means, if the user manually closes the browser window,
then that function should be called just before closing that window.
I tried html body "onunload" to call the function, but not working.

Thanks.
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
There is no real way of knowing if the person closes the window, refreshed the window, or navigates to a new page.

If you are trying to clean up a session on the server, that is what the session end events is for.

Eric
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Javascript function