To target or not to target…

So the other day I was playing around with the whole XHTML thing. Now normally I go the whole “transitional” route with my pages. Its a bit more relaxed and yet it keeps everything nice and neat.

However, on this particular day I started playing with “strict” (here is a nice article on the differences between strict and transitional). What hit me right away is the fact that strict does not allow you to target in a hyperlink.

I other words…this is illegal:
<a href="http://www.creativeui.com" <strong>target="_blank"</strong>>Link Text</a>

Now some people get around this by using a bit of javascript such as this:

function externalLinks() 
{
    if (!document.getElementsByTagName) 
         return;

    var anchors = document.getElementsByTagName("a");
    for (var i=0; i<anchors.length; i++) 
    {
         var anchor = anchors[i];
         if (anchor.getAttribute("href") && anchor.getAttribute("rel") == "external")
              anchor.target = "_blank";
    }
}

window.onload = externalLinks;

This will work, but it seems to go against the spirit of the Strict definition…I mean, if you are gonna open up a new window, you might as well just go with Transitional.

If you have been a reader for very long, you have probably noticed that I typically use target on all external links. I do that because I personally like when sites do this for me. I don’t know why, but it irks me when a link keeps me in the same tab. Most of the time I just avoid it by right clicking and say “open in new tab”.

However, after thinking about it and talking to other designers it made me realize that I was taking choices away from the user, because if you use target and the user wants to stay in the same tab, they can’t…

Since UI design is all about enabling the user, this doesn’t seem right. So, I am leaning towards not using target in my links in the future. What do you think? Do you prefer when sites open tabs/windows on external links (especially on a link heavy page), or would you rather be in control?

4 Comments so far »

  1. Biscuitrat said,

    Wrote on June 23, 2007 @ 11:02 am

    It’s bad practice to set a target because you’re manipulating how pages will show pop up for your users. Unless you absolutely need a pop-up or something, don’t worry about the target property. It’s annoyed me for as long as I can remember, so don’t do it!

    Strict is infinitely nicer and neater because it actually has structure. Stick with it, and keep it valid!

  2. Biscuitrat said,

    Wrote on June 23, 2007 @ 11:03 am

    Correction: the URL is http://validator.w3.org/. It didn’t need a WWW.

  3. David Baxter said,

    Wrote on June 25, 2007 @ 8:39 am

    Heh, well I tend to agree with you, because the more I think about it, the more it doesn’t seem right to take options away from the users.

    David

  4. bien jouer au poker said,

    Wrote on June 18, 2008 @ 4:55 pm

    ganar ala ruleta…

    AlsErgebnis polly poker giochi on line roulette des jeux de poker à telecharger holdem poker download online casino com…

Comment RSS · TrackBack URI

Leave a Comment

Name: (Required)

E-mail: (Required)

Website:

Comment: