Wednesday, October 28, 2009

Close parent browser window, without a prompt

Hi,
After a lots of digging and permutations & combinations, finaaly I got the working solution for the problem of avoiding the prompt from IE browser when we try to close it using Javascript.
I have not tested in on any other browser other than IE and can guarantee that this works fine with IE.
Code:

function openPopup()
{
window.open('','_self','');
window.opener='';
window.close();
window.open('NewPage.aspx','','');
}


Regards,
Soumen