refresh - How is "Are you sure you want to navigate away from this page? " generated in browsers? -


I have a page where I open a "modal window." This is actually a DIV, which is inside IFRAME, where I load another page. When I want to refresh the page, the browser says a window, "Do you really want to navigate away from this page? Reloading this page will remove the modal window. Press OK to continue, or Press Cancel to stay current page. "

How does this message occur? How does the browser understand that I have a modal window, because I have any window from javascript Do not use Open Call? What is a way to disable this behavior of the browser?

It may be that the page loaded in body.onunload IFRAME In the source of

As the modal window is basically an IFRAME, then when you close the main window (or refresh) then the browser knows that it is killing IFRAME, so any Body.onunload in that IFRAME fire.


Comments