Clicking on cancel in confirm box closes my parent window. I want that on cancel it should stay on same page. I have written the following code for it.
function closeEditorWarning(){
var r=confirm("This will close all the opened windows of application.Do you want to continue.");
if (r==true)
{
for (var i=0;i<childWindow.length;i++) {
if (childWindow[i] && !childWindow[i].closed)
childWindow[i].close();
}
self.close();
}
else
{
}
}
window.onbeforeunload = closeEditorWarning;
have you tried removing the self.close();
?
edit: try this...
window.onbeforeunload = function() {
closeEditorWarning();
return null;
}
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.