PRB: openWindow in Anchor Tag Fails in Active Desktop Item (185372)
The information in this article applies to:
- Microsoft Internet Explorer (Programming) 4.0
- Microsoft Internet Explorer (Programming) 4.01
- Microsoft JScript 1.0
- Microsoft JScript 2.0
- Microsoft JScript 3.0
This article was previously published under Q185372 SYMPTOMS
An Active Desktop item that contains a Web page with a hyperlink in the
format <A HREF="javascript:openWindow()> will not work if the openWindow() function opens a new window using window.open(). When you click on the hyperlink that points to the anchor tag listed above, you receive an error from Internet Explorer that indicates that an object is expected. Also, "javascript:openWindow" appears in Internet Explorer's Address box.
CAUSE
The problem is that this method makes some assumptions about the context in
which the code will run. In a browser window, this code would look for the
openWindow() function within the document itself. Active Desktop items are implemented as IFRAMEs of their parent window. Therefore, on the Active Desktop, this code would not find the openWindow() function.
RESOLUTION
Add an explicit _self reference in your anchor tag like this:
<A HREF="javascript:openWindow()" TARGET=_self>
STATUS
This behavior is by design.
REFERENCESFor more information about developing Web-based solutions for Microsoft Internet Explorer, visit the following Microsoft Web sites:
Modification Type: | Major | Last Reviewed: | 5/11/2006 |
---|
Keywords: | kbfix kbprb KB185372 |
---|
|