PDA

View Full Version : target="_blank" in XHTML Strict


ktinkel
01-28-2005, 08:39 AM
I guess I haven’t been paying attention, but was shocked when our DTP Forum home page (http://www.desktoppublishingforum.com/) failed to validate. It came up with errors for every link to messages on the CompuServe forum because I had included target="_blank" in the URLs.

If I changed the DOCTYPE to HTML 4 Transitional (or even XHTML Transitional), there were no errors.

Turns out the W3C wants to discourage us from forcing linked URLs to show up in a new page. I have had many opinions on this topic. I can certainly understand that for someone with a smaller monitor might find it tedious.

On the other hand, I generally hate when I am swept willy-nilly to a new page when I was merely curious about some link I encountered. It is easy enough to click that window away; not always so quick or certain to navigate back to where I really wanted to stay.

I guess this is just a rant. Or maybe even only an observation. Not sure it is a problem that can or should be solved …

Andrew B.
01-28-2005, 09:02 AM
The convention I prefer is "same site, same window - new site, new window." Exceptions can include a page in a site that has a function similar to a foot note or pop-up help.

ktinkel
01-28-2005, 10:30 AM
The convention I prefer is "same site, same window - new site, new window." Exceptions can include a page in a site that has a function similar to a foot note or pop-up help.
I like that. I think I’ll adopt it for myself.

Thanks.

John Spragens
01-28-2005, 11:07 AM
I use that approach, too.

I'm curious whether the new DTD is designed to discourage the new-window behavior or whether there's a different way of tagging things now that accomplishes the same thing.

annc
01-28-2005, 11:21 AM
The convention I prefer is "same site, same window - new site, new window." Exceptions can include a page in a site that has a function similar to a foot note or pop-up help.I'm so accustomed to being taken to a new window, that I've developed the habit of closing the window when I've finished looking at, say, an enlarged version of a thumbnail picture. In Safari, I often find myself accidentally closing my main window with five or six carefully opened and active tabs, thus losing a whole day's browsing history.

Most of my favourite pages are bookmarked anyway, but it's still irritating.

ktinkel
01-28-2005, 11:46 AM
I use that approach, too.

I'm curious whether the new DTD is designed to discourage the new-window behavior or whether there's a different way of tagging things now that accomplishes the same thing.

In HTML for the World Wide Web with XHTML and CSS, Elizabeth Castro has this to say on the question:
The W3C has removed the target attribute from (X)HTML Strict to promote accessibility. Instead, they suggest using JavaScript or the yet-to-be-finalized XLink. I say, use target. (It is part of both (X)HTML Transitional and Frameset.)

Steve Rindsberg
01-28-2005, 12:47 PM
Use javascript? Now there's a can of worms. Guaranteeing that the link won't work at all if the user has javascript disabled? This doesn't sound very reasonable to me, though it's more sensible than converting to "standards" that aren't necessarily standard yet. Tsk.

You can make the case that new windows are forcing something on the viewer that they can, after all, control themselves. You can make that case ... I won't. <g> I'd generally prefer a new window. Easy enough to close it when I'm done.

ktinkel
01-28-2005, 01:24 PM
Use javascript? Now there's a can of worms. Guaranteeing that the link won't work at all if the user has javascript disabled? This doesn't sound very reasonable to me, though it's more sensible than converting to "standards" that aren't necessarily standard yet. Tsk.

You can make the case that new windows are forcing something on the viewer that they can, after all, control themselves. You can make that case ... I won't. <g> I'd generally prefer a new window. Easy enough to close it when I'm done.
Exactly. Least damage, seems to me.

But see Ann’s comment. Guess one’s mileage may vary. :-)

Ian Petersen
01-30-2005, 11:51 AM
Kathleen,

As usual, Alistapart has a solution: http://www.alistapart.com/articles/popuplinks/

ktinkel
01-30-2005, 12:01 PM
Kathleen,

As usual, Alistapart has a solution: http://www.alistapart.com/articles/popuplinks/
And why didn’t I think of that? <g>

It is cumbersome, though. But I’ll give a try. Soon.

Thanks. See? We really need you around here.

Ian Petersen
01-30-2005, 12:45 PM
Kathleen,

It is cumbersome

One can't really separate XHTML, CSS, Javascript and the DOM anymore they're all different sides of the same coin. Stuff that has traditionally been done with HTML is now farmed off to CSS or JS 'coz they're better tools for the jobs in hand. We all kicked and screamed when we had to forego simple font tags for nasty complicated stylesheets. Using JS for interface stuff is a similar situation.

See? We really need you around here.

I'm not sure about that, but I do try to peek in once in a while. I'd still prefer some kind of offline access though. <g>

LoisWakeman
01-31-2005, 03:21 AM
Kathleen,

I'd like to go against the flow here. I like to manage my own desktop and browsing, and can very easily open a link in a new window if I want. Given the great accessibility/usability disadvantages of spawning new windows all over the place, I think losing target is a good thing on balance.

I have extended thoughts on this on my website:

http://lois.co.uk/web/articles/new-windows.shtml

Lois

ktinkel
01-31-2005, 05:34 AM
I'd like to go against the flow here. Good! We like that. :-)

I like to manage my own desktop and browsing, and can very easily open a link in a new window if I want. Given the great accessibility/usability disadvantages of spawning new windows all over the place, I think losing target is a good thing on balance.Since I hold contradictory views on this (and many other) topics, I do see your point.

And I imagine that people with small screens must curse new windows, as they may obscure the original page, which can be really confusing.

But you and I and others here are not average web users. Many people seem to browse semi-consciously (the man I am married to, my personal ‘everyman’!) does, anyway. He appreciates a new window because he sees that he can click it away without losing everything. Otherwise, he closes the (only) window and says Huh?

LoisWakeman
02-02-2005, 12:05 AM
But you and I and others here are not average web users.

Very true - but it all depends who you observe. As well as the scenario you describe, there is the one where they switch to one or more serial new windows for new sites, aren't interested, and try to use the Back * button to return to the first one. Finding it doesn't work, they give up and do something else instead, as the window they want is now buried in the stack (taskbar - what's that?)

Whatever solution we choose, someone will come unstuck. I think accessibility concerns give the edge to single window inmplementations, except in the case of pop-ups to show definitions, full-sized images, etc.

* according to Jakon Neilsen, the Back button is the second most used navigation device after clicking on links!

Oh, and a new point that doesn't appear in the article I quoted. I now use Firefox as my #1 browser, in common with many others, and have become a great fan of using tabs. Opening a new instance of the browser is really annoying on my tidy, tabbed web desktop, and requires me to switch mentally between the two UI models. OK, only a few seconds' confusion every time, but I can do without it!

ktinkel
02-02-2005, 06:03 AM
… there is the one where they switch to one or more serial new windows for new sites, aren't interested, and try to use the Back * button to return to the first one. Finding it doesn't work, they give up and do something else instead, as the window they want is now buried in the stack (taskbar - what's that?)One of the hardest things to do, I find, is to know how others use web browsers. Just watching my husband is enlightening; he doesn’t have any particular interest in the process, only the result.

Whatever solution we choose, someone will come unstuck.True enough!

I now use Firefox as my #1 browser, in common with many others, and have become a great fan of using tabs. Opening a new instance of the browser is really annoying on my tidy, tabbed web desktop, and requires me to switch mentally between the two UI models. OK, only a few seconds' confusion every time, but I can do without it!Hmmm. Something else to think about. Although Safari and Firefox have tabs, I have given up on them for now. I need to learn how to use them efficiently, and don’t have the time (or mental energy, or something).