I have a small website who’s client side framework is jQuery.
I have a page where I need to do some AJAX action before the page unloads but that action may not fire if a certain button was clicked.
I was trying this with:
<body onbeforeunload="myaction();">
But how do I know that certain button was clicked or not?
You can bind
onbeforeunloadintojQueryalso: