Hi
We have a jsp page which is inside an IFrame. We want to warn the user when he clicks any other link and leaves the page and ask him if he wants to stay on the current page. Following is the code that has been implemented for this.
window.onbeforeunload = confirmExit;
function confirmExit()
{
return “Do you want to leave this page without saving?”;
}
When the user navigates to another page, the confirm dialog comes up with the message “Do you want to leave this page without saving?”, but if the user select “No” option from the pop-up, the same message pops-up for the second time. If the user selects “No” for the second time, it stays at the current page but the request attributes and parameters already existed in that page are lost. Any one have any idea why this is happening?
If we implement this code without Frame, I mean for plain single page within browser then it works fine.
Thanks