On Aug 25, 2005, at 12:33 PM, Thierry Koblentz wrote:
Ben Curtis wrote:
1- link replaces current document (no target or js new window)
2- link always opens new window (target="_blank" or js equivalent
with unnamed window, e.g., window.open(this.href,'',winOptions);)
I agree, the opener getting focus each time the user clicks on a
link create
problems with named windows (using target or JS).
But I think one can use the following to make sure named windows
pop up on
top of the opener.
newWin=window.open(this.href,'zWin');if(window.focus){newWin.focus()}
True, and that does cure the most disabling aspect of named windows.
However, it is still context sensitive in that if you click a link so-
coded which is in a document already in a window named zWin, then it
will open the new document in the same window instead of the other one.
One could, I suppose, code around that, too (wrapping for legibility
only):
<a href="foo.html"
onclick="
if (self.name == 'zWin') self.name = '';
var newWin = window.open(this.href, 'zWin');
if (window.focus) newWin.focus();
return ! newWin;
">Open Foo</a>
But you still haven't coded around the contextuality, since now you
have opened a new window, but which window has what name? If other
links point to zWin, which window is that? Your arrangement of
windows, and what the targets actually point to, is dependent on
previous user actions, which are unpredictable. So, to be
predictable, links either need to "target" self (no target, no new
win), or always open a new window.
The merits of always knowing your context are as debatable as whether
one should be opening windows in the first place, anyway.
(Of course, if you were to try this sort of thing, you'd be applying
it unobtrusively and not inline like the example...)
--
Ben Curtis : webwright
bivia : a personal web studio
http://www.bivia.com
v: (818) 507-6613
******************************************************
The discussion list for http://webstandardsgroup.org/
See http://webstandardsgroup.org/mail/guidelines.cfm
for some hints on posting to the list & getting help
******************************************************