I need to check if browser is navigating to another page or closing. My idea is;
- Create global variable
var isNavigating = false;
- Bind click event to make
isNavigating = true
of every anchor which will navigate to another page - Check if
isNavigating
true on body'sunload
event.
Any other ideas? Recommendations?