Closes a window in IE 5.x only. Allows you to close a browser window without the
Users permission. If using IE, the window.close() command will prompt for the
users permission to close the window if the window was not opened by the
window.open() command or as a new window. Gives the following error in IE
6.0 - "This operation can only function within HTML Help"
If you want more information on closing a browser window see "Closing
Browser Windows". The rule in a nutshell is if the browser window
was created by the user, then you can't close the window without the users
permission.
window.close() - Use the standard
window.close() method.
hhwinclose.Click() - IE 5.5 -
Closes
the window without asking for users permission. Gives the following
error in IE 6.0 - "This operation can only function within HTML
Help"
ex_window_hhwinclose_frameset.htm
(Same Window)
- Frameset example (same window or _self). The window.close() function
will prompt the user for permission to close the window. Notice
that the hhwinclose.Click() does not!
For hhwinclose.Click() to work you must embed an object into your html page:
JavaScript Only
<!-- to close the current window without dialog box to close -->
<object classid="clsid:adb880a6-d8ff-11cf-9377-00aa003b7a11" id="hhwinclose"
style="display:none;" type="application/x-oleobject">
<param name="Command" value="Close" />
</object>
Use a button
<OBJECT
id=MyControl
type="application/x-oleobject"
classid="clsid:adb880a6-d8ff-11cf-9377-00aa003b7a11"
codebase="HHCTRL.ocx#Version=4,72,8252,0"
width=100
height=100
>
<PARAM name="Command" value="Close">
<PARAM name="Button" value="Text:Close this window!">
</OBJECT>