User Experience and target=”_blank”

By Michael Fienen - Tue, Jan 6, 2009

Usability, Web development

Despite how much people don’t want it to be true, using target="_blank" when coding pages is becoming less and less of an accepted practice.  But don’t take my word for it.  There’s a reason that strict (X)HTML has dropped the target attribute from valid specs, and really, it’s a good one:  designers/coders should not be making decisions for the user as to how a page opens.  We might not like it, we might not agree with it, but in the end we should cede behavioral attributes to the user, who should be able to control their own experience.  There’s no good reason not to let them, too.  The marketing side of the argument is that you want to keep people on your site rather than send them away, and many times this is a harmless inference, but in the end if a user no longer wants to be on your site, they will leave whether or not you’re directing their links into a new window.  Additionally, it is suggested that lay users find new windows opening to be confusing, frustrating, and an annoyance when it breaks accepted navigation, such as a browser’s back button (discussed in both Jakob Nielsen and Johan Petersson’s articles linked above).

Modal option boxI’m a code-nazi, and I admit that.  Generally, if I can’t code it to strict standards, then I don’t code it.  But until recently, the target attribute has been a fuzzy area for me, where I had a habit of fudging for the sake of what I thought was appropriate behavior.  After some soul searching though, I have decided to not only drop it from personal usage, but also adapt a new way of using it on our college’s web site.  With the technology and code we have at our disposal as designers and developers, there’s little excuse as to why we shouldn’t give users the control over how the site works for them.  Let them do what they want, and help make their experience the best you can.  That is how you make a positive impact, and leave them wanting to come back again.  If you feel like you need to force a user to stay on your site for some reason, maybe you need to look at what’s wrong with your site that makes it a destination that isn’t compelling enough to attract and retain visitors on its own.

Problem: Remove a web site’s reliance on the target attribute while giving the visitor a way to persistently customize their ability to interact with links leading off of your web site.
Solution: Create non-targeted links that are progressively enhanced to allow the user to set options for opening external links in new windows through an options modal.

So, what can we do about this?  Better yet, what should we do about this?  There is one argument in particular, that trying to give users control at the web page level is redundant and duplicates existing functionality.  I respectfully disagree.  First, in my experience, lay users rarely know the shortcut to opening links in new tabs/windows.  Secondly, there is value to letting a user control their experience on your web site.  It allows them to impart a consistent, pleasant user experience across the board, and lets them do things like override content contributors who might not subscribe to my or your critical sensibilities on the matter of the target attribute.  When you have a hundred different people doing God knows what with content and code as they build your college’s web site, any opportunity to normalize the experience is something you should take.  And lastly, sure, I’ll admit that it might be a tad redundant, but it’s cool, it’s useful, and it barely takes any time to implement.  The key is that web sites no longer exist in a static shell, and by giving users control, you are acknowledging them as an audience, and showing value to their opinion as to how things should work.  You’re saying “Hey, this is how we think stuff should work, but really, you might not like it.  So here’s a way to make it do different stuff.”

There are a lot of folks out there discussing JavaScript alternatives to target="_blank" like using onclick="window.open(this.href);".  I must chastise these people for being so careless that they want to maintain strict code, but also want to ignore the reasoning for not using it.  The fact of the matter is, that kind of solution ignores usercentric design principles in order to keep the target attribute around, without actually using it.  It’s a loophole, not a solution.  And really the only way a user has to control that activity is to disable JavaScript all together.  Not a happy medium.  The first viable option I found was over at Dynamic Drive.  They had a nice script that used cookies to allow a user to select how they want external links handled.   This script works well, and really, there’s nothing wrong with it if you want to play with it.

But, me being me, I wanted to see what I could do on my own.  We are already using jQuery for some progressive enhancement, so I decided to go that route.  And while JavaScript has cookie handling built in, I thought this would be a nice opportunity to try out the cookie plugin, which streamlines the process.  The basic function I was going for was that it would operate such that by default, links going somewhere besides the basic domain open in a new window.  The user can then change this on any page on the site though, by unchecking the option in the footer.  That selection is saved to a cookie for 90 days.  This allows them to decide where they go when clicking external links, and by using jQuery, I can even override the behavior of links precoded with a target attribute.  On top of the cookie plugin, I decided to jump on the SimpleModal plugin too, which you see a screenshot of above, which can allow me to make a nice options interface as we add more user control of the site (think font size, colors, navigation enable/disabling, etc…).  The end goal is a usercentric, flexible design, that puts them in charge over some of the finer behavior of the site.

First, this works great.  Secondly, it’s a nice progressive enhancement, as users without JavaScript enabled just don’t get the option and their overall experience on the site isn’t damaged.  While I’m not going to go over a full howto on setting it up, you can see a demo of this in action, or take a look at it in action at the Pittsburg State University site – scroll to the bottom of the page and click where it says “site options.”  And this doesn’t mean that there aren’t exceptions to this rule, but I find under scrutiny, they are few and far between, there are right ways to handle them, and if you absolutely MUST use them then maybe you need to look at what the data is and how you are handling it to see if maybe there isn’t a more base problem in the user interface or information architecture.


Like this post? Be sure you've subscribed to the .eduGuru RSS feed or email to get all the latest news and articles.


, , , , , , , , , ,

Read Related Posts on .eduGuru:

  1. Email is about hitting your user over the head with a sledgehammer
  2. Tracking outgoing clicks with Google Analytics
  3. Accessible Twitter

This post was written by:

Michael Fienen

Michael Fienen - who has written 61 posts on .eduGuru

Michael joined Pittsburg State University in Pittsburg, KS (NOT Pennsylvania, they spell it wrong anyway) in 2006 and is currently the Director of Web Marketing.  He is also CTO for the interactive map provider nuCloud. Web development's role in interpersonal communication is a principle focus of his efforts to improve and enhance higher ed web commodities.  He is an active supporter of the dotCMS community, accessibility advocate, freelance consultant, frequent speaker at web events, and general purpose geek who wears many hats.  Read his complete bio.

Michael's Blog Michael's Facebook Michael's LinkedIn Michael's UWebD Profile Michael's Twitter Michael's Flickr Michael's YouTube Michael's Digg Michael's FriendFeed Michael's Profilactic Michael's Google Profile Michael's FoursquareProfile


17 Responses to “User Experience and target=”_blank””

  1. Billy Says:

    Interesting post Michael and a stylish (but unnecessary, I think) solution. It seems like this issue is going to stick around forever but I disagree with a couple of your conclusions.

    Rather than becoming less and less of an accepted practise, I’d say that the argument is now moving in the opposite direction again.

    The case against opening in new windows was clear and accepted by all a couple of years ago but with the widespread use of multiple tabs in browser behaviour and stronger processing power I find myself once more questioning this golden rule. I’m still sticking with no new windows at the moment but I can see the possibility of this changing in the future.

    While interesting, I really do think the Pittsburgh solution is redundant, if users can’t be bothered to edit the user controls available in Google (which the vast majority don’t), how useful is it really to have the choice of whether external links open in a new window on a single particular site?

    Useful to a couple of users, but it would be more useful surely to reduce screen clutter by removing the site options link from all pages. (Pittsburgh looks like a great site btw, I’ve never seen it before but I’ll try and find the time to have a proper look round it).

    I like your argument about different content creators on a site applying different methods. It’s a common problem but I’m not convinced that allowing a couple of users to decide for themselves is the solution.

    Reply

  2. Chris Falzone Says:

    Very Nice Article Michael. I’ll have to see about putting this into use for my uni’s redesign.

    Reply

  3. Shelby Thayer Says:

    Great post, Michael. I must say that sometimes I am still guilty of using _blank. I must change that!

    The options you present are nice. My only issue with them is that if the argument is that lay users don’t know to use the new tabs/windows shortcut, doesn’t the same logic apply to site options? Won’t those same lay users have no idea that those options are there (or even what they mean)? The more savvy users that know they are there are the same ones who already know the new tab/windows shortcut anyway?

    Although I do think the site options are a good enhancement, at least for now, I think they are an enhancement for savvy users.

    By the way, I *love* the option to flag offsite links with the icon.

    Reply

  4. Michael Fienen (author) Says:

    Billy: Your points are absolutely valid and in no particular way incorrect. The back and forth argument on this topic has been well-hashed elsewhere, generally without total resolution. The only thing I would stress is this:

    Be it a tab or a window, the base effect is the same, you’re sending people away from your site in an attempt to keep it open, without regard for the users’ wishes. I have yet to read convincing commentary that tabs make this okay. I believe that is the user’s choice to make unilaterally, and we should help them do it.

    And while such a solution as mine is somewhat redundant, it is designed with purpose, to allow the user options, where they didn’t previously exist. Blanket statements about user behavior rarely stick, and rather than try to assume I know how my users act in all cases, I find giving them the option is preferable to not.

    That’s just me though. I suspect this subject will continue to bounce back and forth over the coming years, undoubtedly. As a user, personally, I actually like it when I leave a site and it opens a new tab, heh.

    Reply

  5. Michael Fienen (author) Says:

    Shelby: You are 100% correct, and I probably should have clarified this more. What you are posing is a chicken and egg argument, what changes should we make first. I tend to do everything at once, then educate, educate, educate. Moreover, look at it this way:
    - Remove the target attribute, this is to simplify things for lay users.
    - Create options, which actually are for the more advanced users.

    Reply

  6. Heidi Cool Says:

    I think we’ll be arguing about this subject for several years to come. I’m in the “let the user decide” camp and don’t set links to open in new/windows or tabs. Back in October, I made a case for this in Should you or should you not have links open in a new window/tab? and was astounded by the number of people who wrote back in favor of links opening in new windows.

    Your idea poses an interesting option, in that it gives the user choice, but I think I would make the default be the same window (standard behavior) while letting them opt-in to the”new window/tab” option.

    Reply

  7. Chris Falzone Says:

    While I sit on the “no target as a standard” and let the user choose camps, my personal preference is to open external links in new windows OR mark them somehow so I know they are external so I can use a shortcut to open a new tab.

    Unfortunately my uni’s policy is that external links must open into new windows. And that’s a lot better than they used to do which was a pop-up explaining that you were leaving the website. I plan on bringing this up at my next meeting, but I have the suspicion that the _blank votes will win.

    Reply

  8. Kyle James Says:

    I’ve always been on the side of the open links off site in a new window, as anyone that has read any of my posts here will know. For me it comes down to the marketing and not wanting them to leave the site. I’m totally about the user experience and letting users choose, but I guess I still believe that people aren’t to the point where they don’t need hand holding yet. The audience of this blog probably doesn’t need hand holding, but then it comes back to the marketing reasons.

    Like everyone else here I think there really isn’t a perfect solution for this and we will be debating it for years to come.

    Fienen I do really like that instead of just readdressing the issue you present possible solutions and alternatives and there is definitely a lot of value in that. This is really interested maybe it’s something we would want to tinker with on this blog?

    Reply

  9. Frank Says:

    I’d have to say this is a pretty subjective issue. Although I’m on Kyle’s side of things, I like to keep my visitors on my site. So if that means externals create a new window then that’s what I need to do as of right now. Although I do like the idea of letting the user ultimately decide the future course of action for open links.

    Reply

  10. India Software Project Outsourcing Says:

    Hey I liked your article. Pretty interesting and helpful. After this I will be working in this way..

    Reply

  11. David Says:

    Personally I could go either way with links to web pages, but links to documents such as PDF, .doc, etc. is in my experience, necessary. I have many seen users with settings allowing docs to display in the browser, close their browser thinking they were closing acrobat or word. These users end up frustrated and confused, and are forced to start their browsing experience over.

    Reply

  12. Mark Says:

    Opening in a new site is essential. You could hardly build a successful site without it.

    Reply

  13. Julian Says:

    Opening a new windows is especially bad on the iPhone, since it doesn’t let you tap “back” then and you may have already the maximum number of sites open.

    Reply

  14. Michel Says:

    Clicking on the “site options” which I would never have thought of clicking if you had not told me to, I in FF 3.6 get

    Error: j(“#siteOptionsModal”).modal is not a function
    Source File: http://www.pittstate.edu/global/js/jqueryInc.js
    Line: 77

    Reply

  15. Michel Says:

    PS: great article. Made me think and decide to redesign one of my sites. About high time too

    Reply

Trackbacks/Pingbacks

  1. [...] is usually done by adding the target=”_blank” attribute to a link, but there are many schools of thought on this one. Let me give you the marketing reason to do it: A visitor is on your site and they click on a link [...]

  2. [...] Just remember that every time someone uses target=”_blank” a kitten dies somewhere in the world… http://doteduguru.com/id1765-user-experience-and-target_blank.html [...]

Leave a Reply

Spam protection by WP Captcha-Free