My pop-up window is written like this
$('# aa').click(function(){ //Button click event
$('#w').window({//Window initialization
title:'Just click',width:400,height: 300,iconCls:'icon_add',
//Important part
onBeforeClose:function(){ //Events triggered before the panel is closed
if (confirm('The window is closing, please confirm your current The action has been saved.
Do you want to continue closing the window? ')) {
$('#w').window('close', true); //The close method is called here, true means that the onBeforeClose callback function is ignored when the panel is closed.
} else
return false;
}
});
}); When clicking the button of the class, the confirm window will pop up. Click OK to close the window, and click Cancel to keep the window.
If you don’t want the prompt to pop up, just call: $('#w').window('close', true)