Alessandro C
Alessandro C

Reputation: 3560

How to intercept window close without mismatching with location change?

I'm using window.onbeforeunload to intercept window close event. I've noticed that window.onbeforeunload is triggered even on location.href change and form submit.

I want to intercept only the event: "the user has closed the page". How can I do it?

**I'm open to both JavaScript or jQuery solutions.

Upvotes: 0

Views: 129

Answers (0)

Related Questions