Javascript error: The [object] Oops when open new window with the window.open() Method

The [object] Oops

The “[object] Oops” is what happens when the opener page is overwritten with the text, “[object]” or “[object window]” as a result of the open() method being directly invoked from the HREF attribute. This occurs because the open method returns an object reference to the browser window. To avoid the [object] oops, use the void operator in front of the method call:
<a href=”javascript:void window.open(file,name,props)”>…</a>

More about The Window Object’s open() Method

Advertisements
%d bloggers like this: