mercoledì, marzo 04, 2009

Using JavaScript to Close the Parent Window Without a Prompt in IE7

Dotnetslackers.com has a handy tip for avoiding the prompt that occurs in IE when trying to close the parent window from JavaScript. How does it work? In IE7, you can't close a window unless it was opened by a script. However, you can make the browser believe that it was opened by a script.

window.open('','_self','');
window.close();