Microsoft KB Archive/257321

= PRB: The Window.open File Within HREF Returns [OBJECT] in Current Window =

Article ID: 257321

Article Last Modified on 5/11/2006

-

APPLIES TO


 * Microsoft Internet Explorer 4.0 128-Bit Edition
 * Microsoft Internet Explorer 4.01 Service Pack 2
 * Microsoft Internet Explorer 4.01 Service Pack 1
 * Microsoft Internet Explorer 4.01 Service Pack 2
 * Microsoft Internet Explorer 5.0
 * Microsoft Internet Explorer 5.01
 * Microsoft Internet Explorer 5.5

-



This article was previously published under Q257321



SYMPTOMS
The browser window's page disappears and is replaced by the word "[object]" when you use the following code to open a new window from an HREF:

Click here



CAUSE
This problem occurs because the browser is navigating to the window object returned by the Window.open file call.

This behavior is by design.



RESOLUTION
To resolve this problem, perform one of the following:

  Add a void (0), as illustrated here, to give a no return value: Click here -or-

  Call your own JScript function to open a new window. This prevents the hyperlink navigation and allows you to retain a reference to the opened window. 

var childWin;

function OpenUrl(url) { childWin = window.open(url); }



Click here </li></ul>

<div class="references_section">