Reputation: 3
I want to call a server method on browser close, is their a way, I have tried
window.onbeforeunload
but this gets call even when I refresh the page, I want to call it only when browser is closed is their a work around.
Upvotes: 0
Views: 117
Reputation: 3348
As far as I know, you can't differentiate between those events. Refreshing, loading another page or closing the browser is exactly the same (all the content is destroyed).
Upvotes: 1