close Method
Closes the current browser window or HTML Application (HTA).
Syntax
window.close()
Return Value
No return value.
Remarks
The way that you close a window programmatically determines whether the user gets prompted. If you invoke the close method on a window that you did not open with script, the user sees a confirm dialog box. This also happens if you use close to exit the last running instance of Microsoft® Internet Explorer. You can only use the close method silently with HTAs. In the case of HTAs, the application is trusted and follows a different security model.
When a function fired by an event on the BODY object calls the close method, the window.close method is implied. When an event on the BODY object calls the close method, the document.close method is implied.
Applies To
[ Object Name ] Platform Version Win16: Win32: Mac: Unix: WinCE: Version data is listed when the mouse hovers over a link, or the link has focus.
Did you find this topic useful? Suggestions for other topics? write us!
© 1999 microsoft corporation. all rights reserved. terms of use.