Mark Brown's Blog

TFS, Visual Studio, SQL Server, BizTalk, SharePoint, .Net, and more ...

How to close window (self) without prompting in IE6 and IE7

Scenario
Web application wants to pop-up a window as a certain size, chromeless, etc.  However doesn't want to have the opening (parent) window show.  Common usages are launching from shortcut or an application.

Solution
In the "parent" page that launches the popup.   Put the following code to close your(self) in javascript: 

var self2 = window.open("", "_self");
self2.focus();
self2.opener = self2;
self2.close();

Published Tuesday, August 25, 2009 3:06 PM by mab
Filed under:

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

No Comments

Leave a Comment

(required) 
(optional)
(required) 

  
Enter Code Here: Required
Submit

© 2009 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Microsoft
Page view tracker