tags:

views:

34

answers:

2

how we can call a java function when we press browser close button...mins when when we close the browser...

+2  A: 

You can't tell from JavaScript when the browser window gets closed. The closest you can get is the onbeforeunload event that is supported by all major browsers and will fire when the current page gets unloaded - that can have a lot of reasons though, e.g. a simple navigating away to the next or previous page.

Pekka
+1: That's the answer for me :)
Sarfraz
A: 

You can't invoke js based on a non DOM element's event, the browser buttons that is.

Babiker