[thelist] Another Pop-up Question

rudy r937 at interlog.com
Sat Nov 17 20:05:03 CST 2001

> may i suggest that you also include "screenX=0,screenY=0".
> this is necessary for some versions of nn4.  that means you'll be adding
> "top=0,left=0,screenX=0,screenY=0" to each of the window.open() calls.

good call, jeff, you beat me to it

actually, this was on my FQA ("frequently questioned answers") list the
other day --


except i had different values, so that you could make the mental tie-in
between left/top and screenX/screenY --


come on folks, send me those contributions -- surely in your web
development travels you've encountered questions that have come up over and
over and that would make great additions to the FQA list...  please send
them either on thelist or to me directly at r937 at interlog.com

> additionally, you can have non-js browsers open the image up
> in a new window (albeit it not a js popup) by using the target attribute.

this is somewhat problematic, because target is not a valid attribute
unless you're using the frameset dtd, and in the context of a javascript
popup, i doubt that we're talking about using one of the frames as an
alternative to the popup -- rather, this relies on the (incorrect?)
behaviour of (most?) browsers to open a second window

> you can also use the this keyword and the target property as the
> second argument of the open() method reducing your typing as well.
> like so:
>   <a   href="hi_altitude_jacketlg.html"
>             target="hi_altitude_jacket"
>                 onclick="window.open( this.href  ,this.target

yes, this is a great tip, it makes for cleaner, consistent coding, and just
about (but not quite, at least not for me) offsets the negative aspect of
not validating

there are really two types of link to be considered -- those that leave
your site and those that don't

if the link does not leave your site, my feeling is you may as well default
the non-javascript user -- remember, this is in the context of opening a
popup -- to the same window, i.e. leave out the target attribute

if the link does leave your site, it's a bit tougher to make the call (but
i would wonder why you're opening up some other site in a popup anyway)

in any case, opening all links in the same window is at least consistent
and predictable behaviour, since if the target attribute is used, the user
ends up in a second window, which has a good chance of being maximized, and
then you have the situation where the back button doesn't work (if anyone
doesn't understand this part, please ask)

so bottom line, at least for me, is that leaving the target attribute out
is the preferred route to go -- it validates and it's more user-friendly

as always, remember that it's just imho, ymmv, and brb


More information about the thelist mailing list