Tuesday, February 26, 2013

Tip: Close an IE popup properly.

In order to close an IE popup that is opened through the window.open function, one has to use the following code:

Assume that before closing the popup, we need to update the parent window by calling a javascript function. The declaration of the button that closes the popup:

<input id="btn" onclick="opener.callParentFunction(params); window.close(); return false;" type="button" value="Close Me" />

Please note that the javascript statement in the button must contain the "return false" statement or else  IE will not respond to the close command.

No comments: