PDA

View Full Version : window.open leaves [object] in original window


katlas
07-18-2002, 06:14 PM
I am using window.open to with a link to open a new window, but no status bar -- works fine, but the original window has [object] in it -- not the original page. What's up??? I've never had this happen before... Here is the code I'm using:

<a class="main" href="javascript:window.open('xyz.htm','','statusbar=0');" onMouseOver="self.status='X-Y-Z'; return true;">X-Y-Z</a>

FYI - the xyz.htm page uses frames, if that could make the difference.

Thanks for any help on this,
Kathy:confused:

Mrs G
07-18-2002, 09:21 PM
I think it is because the link is searching for a function that is not there because you have used


javascript:window.open

This works

<a class="main" href="#null" onclick="window.open('xyz.htm','','statusbar=0')" onMouseOver="self.status='X-Y-Z';return false ">X-Y-Z</a>

neil.c
07-18-2002, 09:22 PM
k.

i tested this without frames, it still leaves '[object]' behind.

i've no idea why, one of our resident xperts might though.

anyways, this version works, using onclick instead of href.


<a class="main" href="#" onClick="window.open('xyz.html','','statusbar=0'); return false"
onMouseOver="self.status='X-Y-Z'; return true">X-Y-Z</a>


any better? :thumbsup:

neil.c
07-18-2002, 09:22 PM
d'oh!

mrs g beat me to it.

katlas
07-18-2002, 09:43 PM
Thanks to you both -- I could hace sworn I've done the javascript:openwindow before with no problems -- but I think the link was an image before -- don't know if that matters either....

Anyway, thanks again,
Kathy:thumbsup: