conditionally browser's confirm-exit pop-up alert when user leaves the page is not working in Non-IE browser
window.onbeforeunload is being used in userworkform HTML which conditionally displays the browser's confirm-exit pop-up on page navigation. This pop-up is displayed only when the page is closed (browser is exited) but not when the user clicks on the 'Continue' button to move to the next page of the application (this is accomplished by adding window.status to the button code in the application)
It works fine in IE but in FF/Chrome upon exit of the browser, the confirm message (pop-up) does not display and upon clicking the 'Continue' button, it displays a different alert message (this message is not our custom message but out-of-the-box firefox message). Attached is the screenshot.
window.onbeforeunload=confirmExit;
function confirmExit()
{
if(window.status==" ")
return;
return "Navigating away from this page may result in lost data and the inability to complete the current Account Opening or Update Ownership session.";
}