Quantcast
Channel: Web Forms
Viewing all articles
Browse latest Browse all 23244

How to insert/save the data into the database on closing the browser

$
0
0

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?


Viewing all articles
Browse latest Browse all 23244

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>