我有一个 aspx 页面。在页面上我有一个 javascript 函数
window.onbeforeunload = confirmExit;
function confirmExit()
{
return "You have attempted to leave this page. If you have made any changes to the fields without clicking the Submit button, your changes will be lost. Are you sure you want to exit this page?";
}
这在用户离开页面时执行。然而,它也在部分页面回发上执行。如何检查这是否是部分页面回发并忽略它?