Why is target="_blank" not advisable to use with XHTML?
Asked Answered
S

3

6

It's valid in XHTML 1.1 and WCAG 2.0 guidelines don't have any info about its usage?

I know it's not valid in XHTML 1.0 strict, but if many people are using other things like JavaScript, jQuery, rel attribute, PHP etc.

Does it make sense? It means people don't want to follow validation rules, they just want to skip the validation.

Sculpturesque answered 12/2, 2010 at 7:13 Comment(1)
See also #3907398Acquainted
S
6

It's mainly to do with separating content from behaviour. The basic premise is that we should use HTML/XHTML to denote content, CSS for presentation and layout, and JavaScript for interactivity.

The target attribute doesn't fit in with this paradigm (it's a bit of HTML content that affects browser behaviour), which is why its use is frowned upon.

Seafood answered 12/2, 2010 at 7:28 Comment(0)
K
4

Why are you trying to force the link to open in a new window in the first place? If the user want to view it in a new window or tab, they should be the one to decide. It's harmful for usability; for example, it stops the back button from functioning correctly, and takes some control out of the users hands. Check out this article for more.

Designers open new browser windows on the theory that it keeps users on their site. But even disregarding the user-hostile message implied in taking over the user's machine, the strategy is self-defeating since it disables the Back button which is the normal way users return to previous sites. Users often don't notice that a new window has opened, especially if they are using a small monitor where the windows are maximized to fill up the screen. So a user who tries to return to the origin will be confused by a grayed out Back button.

link

Kathyrnkati answered 12/2, 2010 at 7:33 Comment(1)
@Firas - Thanks for article , but i never got any complaint about this usability issue from client and client's site users. and my client complaint on that if i do not put target=blank on external link.Sculpturesque
T
2

Except for 4 special target names, the target attribute is used primarily for frames. Since XHTML 1.0 has no support for frames, it makes sense that it doesn't include an attribute designed to operate on them.

Its sad that this also means losing the "open in a new window" effect, but that's how it is

Tu answered 12/2, 2010 at 7:27 Comment(2)
Please note that I am no expert in XHTML design nor a member of any Working Group. This is mostly speculation from 2 separate facts (no frames in XHTML 1.0 and target being used for frames)Tu
Granted. The less popups there are around, the better I sleep at nightTu

© 2022 - 2024 — McMap. All rights reserved.