Question is clear, I need to make an ajax call when user clicks on browser close button, but before closing the window.
Any possible solution for this?
I dont need any confirmation box etc. just a trigger for ajax and then close the window.
Question is clear, I need to make an ajax call when user clicks on browser close button, but before closing the window.
Any possible solution for this?
I dont need any confirmation box etc. just a trigger for ajax and then close the window.
An answer from How to show alert message when closing a window? should work here:
<script type="text/javascript">
window.onbeforeunload = function() {
$.ajax(...);
}
</script>