javascript:window.open() link leaves main window blank with a message reading "[object Window]" in it

RESOLVED INVALID

Status

()

Firefox
General
--
major
RESOLVED INVALID
13 years ago
13 years ago

People

(Reporter: Ronald C.F. Antony, Assigned: Blake Ross)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

(URL)

(Reporter)

Description

13 years ago
User-Agent:       Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.7.6) Gecko/20050223 Firefox/1.0.1
Build Identifier: Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.7.6) Gecko/20050223 Firefox/1.0.1

The subject says it all. Other browsers leave the page as it is, and just pop up
detail/magnified views of the various images.

Since I'm the designer of the site, and you consider that this is a javaScript
programming error on my side rather than a bug in mozilla, then let me know, I'm
interested if that should be the case.

BTW: the same behavior in all mozilla browsers, i.e. Camino, Mozilla and FireFox.

Reproducible: Always

Steps to Reproduce:
1. visit http://www.scolariphoto.com/1_Flow.html
2. click on any of the images in the album
3. pop-up window with large view will open correctly
4. main page will blank incorrectly and show the message "[object Window]"

This is a rather big problem, because if (as planned for a future version of
the web site, the main page is in a window w/o additional navigation bar,
there's no way to get easily back to the album view, and in any case this
behavior is confusing and disrupting for the user of the site.
Actual Results:  
see above

Expected Results:  
main page should remain unchanged and unaffected by any clicks on the pictures
in the album.

Comment 1

13 years ago
Mozilla follows the specs a bit too closely in this situation. Like most
functions, window.open() has a return value: the handle of the newly created
window. A bare script used as a link location will display this value in the
originating window.

You can wrap window.open() with a void() which prevents the return value, or use
a syntax like this instead:

a href="DESIRED_URL" target="MYPOPUP" onclick="window.open(this.href,
USUAL_SPECS_HERE); return false"

This has the added benefit of handling non-scripted browsers gracefully.
Status: UNCONFIRMED → RESOLVED
Last Resolved: 13 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.