[NTLK] Would or wouldn't you prefer the images on my site to open in a new browser window?

Michael J. Hußmann michael at michael-hussmann.de
Sat Aug 14 06:25:16 EDT 2010


Frank Gruendel (newtontalk at pda-soft.de) wrote:

>while working on a web page I have noticed that in HTML 4.01 Strict the
>"target" attribute is no
>longer supported. Although all browsers that I know of still support it
>even if the document type
>actually _is_  HTML 4.01 Strict, this means that, strictly speaking, my
>pages would contain invalid
>html code.
>
>To the best of my knowledge this attribute was removed because the
>powers behind the HTML specs
>think that forcing links to open in a new window is impolite to the
>user. After all, if the user
>wants to open the link in a new window, he can do so without a problem.

In my experience, users expect a link to open in a new window or tab
when that is the obvious choice (but only then). For example, if you see
a forum post linking to somewhere else, you will obviously want to
switch back to the forum post after exploring the link to comment on it,
so opening the link in a new window/tab is the only sensible choice.
Yes, users could make sure the link will open in a new window by using
the context menu, but as a rule they prefer the browser to do the
sensible thing. I wouldn't recommend using target="_blank" so that users
won't leave your site; that's selfish and probably wouldn't pay off in
the long run. But there are certainly legitimate uses of target="_blank".

Now the funny thing is that while HTML 4.01 strict (and HTML 5) have
banned target, you can still achieve the exact same effect with
JavaScript; that's the recommended approach now and ensures your pages
will validate just fine. But why a more convoluted way to achieve the
same objective should be preferred is beyond me (the DOM will actually
be identical whether use the target attribute or JavaScript). I still
use target="_blank" where it is sensible and hope that browsers will
continue to support it regardless of the HTML 4.01 strict declaration (I
mostly use "loose" anyway). If some day browsers should stop supporting
this then the purists will have a field day, but at least I have done
what I could.

- Michael


Michael J. Hußmann

E-mail: michael at michael-hussmann.de
WWW (personal): http://michael-hussmann.de
WWW (professional): http://digicam-experts.de




More information about the NewtonTalk mailing list