I want to execute an action method when the user is abandoning a particular page using jQuery.
The page has the following code:
<script type="text/javascript">
$(window).unload(function () {
alert("Handler for .unload() was called.");
});
</script>
When I navigate away from the page I never see the expected alert.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…