<1> Just add the following script to your page..
function window.onbeforeunload()
{
event.returnValue = "the page will be closed, comfirm to close?";
}
<2>Purpose: By capturing the event of clicking the close button of the browser, a prompt message can be given before the page is closed, prompting it to close.
<3>The extension of the application can continue to add the ajax part later, go to the background operation code, and can be cleared session operations, etc., to achieve the purpose of releasing space.
<4> Mainly used in bs structured applications