i have a simple page running with asp.net mvc
When i click f5 or ctrl + f5 only in FF, server is hitted before "onunload" javascript function is called. it is working as expected in IE. Any knowhow?
Behaviour is like this: 1- Notify javascript function is called, 2- Server side code is called and page is refreshed 3- onunload javascript function is called.
what i expect is 3.step to run before step 2 as IE does.
<head runat="server">
<title>Serdar</title>
<script src="<%=Url.ContentV("~/Scripts/JQuery/jquery-1.6.4.js")%>" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function () {
window.onbeforeunload = NotifyClosing;
window.onunload = UnLockDraftOrder;
});
function NotifyClosing() {
alert('closing');
}
function UnLockDraftOrder() {
alert('unlock order');
}
</script>
</head>
<body>
<div>
serdar
</div>
</body>
</html>