target="_blank" Convention

I’ve been building websites for a while now, and each time I do it, I run into a couple areas where I sit back in my chair for a second, scratch my head, and ponder conventions. One great thing about Ruby on Rails is the way it enforces convention in many areas, but yet there are still a number of things up for debate. The target="_blank" is one such convention that has yet to be settled it seems.

I guess it’s a two sided issue. When do you use target="_blank", and how do you indicate that behavior to the user?

I think the first one is fairly simple. One obvious rule I follow is whenever you’re changing domains the target should be in a new window. Just because someone wants to read a little background behind a hyperlink, shouldn’t mean their done reading the rest of the text on this page. And I usually extend that same principle to other areas, too. For example, I recently built a site that had an editing form, and you could just repeatedly save changes as you went on. I added a “View” link that targeted a new window so that if you wanted to see the changes you’ve made you could without being taken away from editing. So as far as I’m concerned this issue is pretty straight forward.

This one isn’t: giving the user feedback that the link is actually opening in a new window. I can’t seem to find anything that is blatantly obvious. I’ve tried appending “(opens in a new window)”, to the link, but that messes up the design. I thought about changing the color of the link, or using a dashed underline, instead of a solid one, but your basic web user isn’t going to pick up something that subtle. I was also suggested by a colleague to just put text in the title. But the chances of someone waiting that long before their finger slams the mouse is slim. And using JavaScript to load something more instantly, seems bloated.

The most obvious technique I’ve found I saw for the first time with Mantis, a bug tracking system, which was to append a “[^]” to the end of every link. The link, itself would always open in the same window, but if you clicked on that little character, it would open in a new window. But then, why not just right click and let your browser handle it (“Open in a New Window,” or “Open in a New Tab”, Ctrl + Click, etc.).

Ultimately, I think the best solution would be totally default settings that the browser could pick up. Just like a link default is by default blue and underlined. Even then, I suppose it’s a browser setting, but we’d be closer to a consistent solution. Or everyone could just agree to something, which I suppose I’d be OK with…

…as long as I’m part of the conversation.

Thanks for reading! I'm Avand.

I’ve been working on the web for over a decade and am passionate about building great products.

My last job was with Airbnb, where I focused on internal products that helped teams measure the quality of the software they were building. I also built internal tools for employees to stay more connected, especially after the COVID-19 pandemic. Before that, I was lead engineer at Mystery Science, the #1 way in which science is taught in U.S. elementary school classroms. For a while, I also taught with General Assembly, teaching aspiring developers the basics of front-end web development.

I was born in Boston, grew up in Salt Lake City, and spent many years living in Chicago. Now, I call San Francisco my home and Mariposa my home away from home.

I enjoy the great outdoors and absolutely love music and dance. Cars have been an lifelong obsession of mine, especially vintage BMWs and Volkswagens. I’m the proud owner of a 2002 E-250 Sportsmobile van, and he and I have enjoyed many trips to beautiful and remote parts of the West Coast to create good vibes.

What can I do for you?

Read my other posts or get in touch: