Tutorial :When should you use target=“_blank” on your links?



Question:

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?


Solution:1

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....


Solution:2

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.


Solution:3

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...)


Solution:4

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.


Solution:5

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.


Solution:6

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.


Solution:7

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


Solution:8

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.


Solution:9

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.


Solution:10

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).

More info here http://www.ajaxblender.com/open-links-new-window-w3c-valid-target-blank.html


Solution:11

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.


Solution:12

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


Solution:13

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


Solution:14

When you want to open any particular link in new tab on current window then you can use target="_blank" in html.

<div class="restrunt-menu-list">         <ul>           <li>             <span>               <a target="_blank" href="www.example.com">View Menu</a></span>              </li>          </ul>     </div>  

See the snapshot

But It might affect your system performance because all browsers takes a lot of memory when it open a new tab or new window. So less opened tab means less memory uses, less memory uses means better performance.

You can also see that which tab using how mach memory in chrome:

Press shift+Esc , Then you can see Task Manager- Chrome with list currently using memory by each tabs ( in chorme ).

Task Manager- Google Chrome


Solution:15

When you open the link in a new window.


Solution:16

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


Solution:17

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.


Solution:18

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.


Solution:19

I only use it when the client insists.

Otherwise I prefer to let the user decide.


Solution:20

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.


Solution:21

When you are creating an email for mobile users and are linking to external content. That way, when they click on the link they will open the page in their browser.


Solution:22

For all external links...


Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Previous
Next Post »