javascript

Page closed event detection in javascript

You can use the event “beforeunload” for catching this event, like this

javascript/jquery events

Code:

@section scripts
{
<script type=”text/javascript”>
$(document).ready(function () {
$(window).on(‘beforeunload’, function () {
return ‘Do something…’;
});

});
</script>
}

Leave a Reply

Your email address will not be published. Required fields are marked *