How to close window in ie using link and onbeforeunload?
Posted
by Salil
on Stack Overflow
See other posts from Stack Overflow
or by Salil
Published on 2010-03-25T12:41:07Z
Indexed on
2010/03/25
12:43 UTC
Read the original article
Hit count: 565
JavaScript
|javascript-events
Hi All,
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");
}
Open
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
© Stack Overflow or respective owner