How to insert/save the data into the database on closing the browser?
I have tried with the event below:
<script type=”text/JavaScript”>
window.onbeforeunload=function()
{
//function goes here(AJAX)
}
</script>
The problem I’m facing is that, onbeforeunload is getting fired each time, also on the page navigation.
I want to save/insert data only on the browser close[X].
Is there any alternative work around for this?