user3405607
user3405607

Reputation: 3

Calling a method on browser close

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

Answers (1)

Damp
Damp

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

Related Questions