I open a pop-up window using following code in main.html
function openwindow(url)
{
window.open(url, "mywindow","location=1,status=1,scrollbars=1,resizable=no,width=650,height=650");
}
<a href="javascript: openwindow('/chats/chat?url=http%3A%2F%2Flocalhost%3A3001')">Open</a>
In My child.html i used
function closewindow()
{
self.close();
}
function closeIt()
{
return "Your chat will be terminated. Are you sure?"
}
<a href="javascript:void(0)" onclick="closewindow();">Close Window< /a >
When i click on close window it gize me alert message that i given on event onbeforeunload but it not close the window when i click on Ok.Also this happens only in I.E. & working fine in mozilla, netscape, safari. I checked it on IE6 & IE8
Any help is Appreciated.
Regards,
Salil Gaikwad
This is an issue from quite awhile. You can try this
but it will close the window without the prompt for closing the window.
Another solution is:
but as far as i know, the window.prompt method in IE7 is blocked.
You can have a look THIS thread where this issue is discussed.