views:

918

answers:

20

When are appropriate situations to use the target="_blank" attribute on your hyperlinks?

edit: To clarify, I know the syntax will open a new browser window. What I am asking is when is it appropriate to do so?

+9  A: 

Whenever you want to annoy users.


More seriously, since this opens a new window/tab, it should be used sparingly, in my opinion.

Most modern browsers have some option (ie: middle-click on hyperlink) to do this for you, so I personally prefer allowing the user to handle this themselves.

However, if you are working on something where there is a non-technical reason for this, such as a sales-oriented site, it's often desirable to open a product brochure in a new window, or something along those lines. However, just be aware that overdoing this leads to my pseudo-joke response above....

Reed Copsey
I would wish that modern web browsers would let users customize how they react to target=_blank as well. Right now Mozilla is the only browser to fully implement this, with opera lagging behind and IE giving me no way to customize this at all.
RommeDeSerieux
Yeah - it would be nice ... I'd even love some way to highlight that a link is target=_blank, so I know that a window will open up...
Reed Copsey
@Reed Copsey: you could probably do it with a greasemonkey script, if you're into that sort of thing
Ben Dunlap
A: 

For all external links...

sasa
+7  A: 

When you want the link to open in a new window, I would assume. I think the time to use this is when people might click on a link that'd destroy what they were doing on the page currently, such as a "help" link on a form.

Though some would argue that you should never use them.

Daniel Lew
A: 

When you open the link in a new window.

crauscher
.... lol, so true
Hugoware
Actually I don't know why this one is down-voted because it answered the original question.
crauscher
+10  A: 

It is most appropriate when you're linking to outside resources that people may want to go to for additional information, reference, etc.

It lets them leave your site without losing their place on your page or have to use the back button.

It also makes sure they have to look at it one more time if they want to close it ;-)

(that last one is a joke and I don't advocate such despicable practices of course...)

Gabriel Hurley
ugh, I'm really not a fan of using "_target" to keep someone on your site. Let the extremely high quality of your content compel people to return, and nothing else.
Ben Dunlap
I've never had reason to use it myself, but I appreciate it when I'm in the middle of a complex javascript-driven site and click the help button or something of the sort. I hate it when links don't indicate if they'll take you away from the current page and end up taking you to other pages, disrupting whatever you were doing on the site originally.
Gabriel Hurley
I agree. If you're using it to prevent someone's in-progress work from being wrecked, fine -- although there may be better ways to address that problem. I just objected to your last sentence ("makes sure they have to look at it one more time").
Ben Dunlap
I certainly agree. It was meant as a joke. Sadly, plenty of people *do* use it for that.
Gabriel Hurley
oops, sorry for trampling on your humor. I need a beer.
Ben Dunlap
+14  A: 

When ever you want to leave the current page as-is.

I've got a feeling your question should be 'When is it appropriate to open a new tab or browser window?'

If so, the answer might be :

  • The current form may be in edit mode, and you want to be able to open another page without either disregarding or saving the current one.
  • You have a data stream like Twitter which you want to leave active while you go off and look at X.
  • There is a specific business requirement to do so.
  • Your users have weak navigation abilities and won't find their way back to the main page.
John MacIntyre
"You're users are weak computer users" -- this is a crapshoot, in my experience. On pages designed for internal company use, I've often seen the use of "_target" only add confusion for my less geeky users.
Ben Dunlap
Well, it definitely has its downside.
John MacIntyre
BTW-I fixed the typo you quoted. ... for the record.
John MacIntyre
Nice. I was tempted to write [sic] but didn't want to be a jerk. ;-)
Ben Dunlap
Maybe add opening PDF documents to the list.
Marko
+6  A: 

Generally I avoid it like the plague. However, perhaps a good example of why you'd want to use that would be if you're building a cart module or something, and you have the "click for bigger picture" link. I think it's ok in that sense.

Keep in mind that whenever you do it, you're assuming you know the user's workflow better than they do (they can always open the link in a new window without you forcing it). In the case of the "bigger picture" link, you'd most likely be correct in assuming that's what they want, but in most cases I wouldn't jump to conclusions.

Joseph
If i need to show a larger version of a picture, i just use some javascript-powered lightbox on top of a usual link. Though leaving target=_blank on those links might still make sense for the javascript-disabled.
RommeDeSerieux
Actually, most web pages should be usable for non-expert users too. In a data entry page, for example, left-clicking a help link will lose your work unless the target is _blank. Some (naive) users might actually not expect a link to f*** up their work...
Tor Haugen
@RommeDeSerieux Absolutely, I wasn't suggesting that was the best way to show pictures by any means. Lightbox is a much better approach, assuming you have javascript capabilities.
Joseph
@Tor I agree to an extent. That's exactly why I said "you're assuming you know the user's workflow better than they do" because you have to have that mentality when you're going about designing the user experience. In your example, it could very well be better, in that case, to open a new window. It all boils down to the user experience.
Joseph
@Tor Haugen Those users need to get out of the IE6 mindset. The only reason users are now accustomized to not thinking where they want to open a link is browsers which do not support tabs.
RommeDeSerieux
I absolutely hate it when sites open "bigger picture" in another window. I try to click back-back-back and it doesn't work. Then I discover that the damn site has opened another window. Well... and I dislike the lightbox things too - they usually have some "cool" animation that makes browsing through the images really slow.
Rene Saarsoo
@RommeDeSerieux Tabs are utterly irrelevant to this question. And if by the 'IE6' mindset you mean expecting links to have a sensible default target, I'll go for the 'IE6' mindset any day.
Tor Haugen
A: 

There exists practice to open in new window links that refer another/external domain (wiki for example).

Svitlana Maksymchuk
Which is usually a bad practice. It breaks the "back" button and gives the impression that the original site just can't bear the idea that someone might browse to a different site.
Ben Dunlap
+2  A: 

I think that you should probably not ask a user experience question in a developer forum, because you will get developer answers.

That said, and as a developer, I open new Windows when I expect (or want) the user to come back and continue working on the site where the link originated.

cdonner
+2  A: 

The only time I would consider it is if you have multimedia on the page.

Best example I can think of - the StackOverflow podcast... I can't tell you how many times I've rushed to click a link in the blog post only to take me off the podcast page!

Also, on YouTube when I click "View Comments", it takes me away from the video page.

Whatever you do, don't use JavaScript to open a new window. That's definitely the worst. Nothing worse than a middle-click only to open a new tab with javascript::garbage in the address bar.

John Rasch
+3  A: 

One thing to be aware of here is accessibility. Built in features to help blind users (text to speech for example) may act weird (or just in a way that's confusing to the user) when you open a new window or tab.

Also, you're breaking the most used feature of every browser...the back button.

Jason Punyon
+1  A: 

Stydying your audience will help you decide on this. Casual websurfers will appreciate target=_blank while tech-savvy people are more likely to get annoyed.

RommeDeSerieux
A: 

I use it for product brochures and the like as I think it is useful for the customer to stay on the product page. I always indicate [new window] next to the link to keep the customer informed. Often the product brochure is a PDF, so I also note that the link will open a PDF.

Use it as you need it, but keep your users informed so as not to annoy/confuse them.

Jim
A: 

I prefer to avoid it, because most users can figure out on their own how to open a link in a new window, even if unsophisticated. My preference is to use an explicitly named destination, e.g. target="somename" if you have a good reason for opening a new window on your own.

JasonTrue
+1  A: 

Only if it, with outmost certainty, prevents the user from having to repeat something.

0scar
+1  A: 

As for XHTML 1.0 strict, it is never appropriate. The target-attribute is deprecated in XHTML 1.0 strict.

Philippe Gerber
A: 

I only use it when the client insists.

Otherwise I prefer to let the user decide.

Emily
but the user always gets it wrong... ;-)
Gabriel Hurley
A: 

Never. If I want to open your link in a new window I will do so.

tomjen
+1  A: 

I might be in the minority here but I like using target="_blank" for my links ONLY when they're meant to be reference links. In most cases, you shouldn't be using it for regular links around a website.

I really don't like it when I click on a link in a blog post or an article and it loads on the same page and I need to navigate back to the original source page.

Stellaire
A: 

target=_blank is deprecated in xhtml 1.0 strict, and since I only write in strict I use Js if I really want to open a new page (or tab) and I only do that for external links (like wiki or so).

Andrea Ruggieri