tomtrio.blogg.se

When i click on a link it opens two tabs
When i click on a link it opens two tabs










when i click on a link it opens two tabs

This is a biggie, backed up by UK government research: The ‘how’ is one thing, but opening a link in a new tab can have serious user experience implications. What if you’re linking to another site you own and you’d prefer the user not to have a new tab opened for them? This is where an automatic solution could get problematic. My biggest issue with automatic implementation is exceptions.

  • At build time, if you’re using a static site generator which is a solid method, though it will slow your build down slightly for the developer: external links are searched for and the appropriate code added as the pages are built, so that all users get the right experience and the page load isn’t slowed.
  • Server side, so that a script is run before the page is served again, this would ensure every visitor got the right code, but it would slow the page rendering down slightly for the user.
  • Using JavaScript to look for external links and add the relevant attributes, but JavaScript can’t ensure every visitor gets the same experience as the script may fail to run, the user may have JavaScript turned off, or a content blocker might be getting in the way.
  • So if you plan open all external links in a new tab you’re probably going to want to do it automatically/programmatically. That increases the friction of writing, something Markdown looks to solve, but what if you forget? What if whoever proof reads your work forgets too? What about typos? Too error prone. There’s quite a lot going on there more than a standard tag with its href="" attribute! You’d write the HTML out in full: This is a paragraph of text with a link in it. The good news is that Markdown allows you to write HTML inside of it, so where you’d normally write a link like this: This is a paragraph of text ( ). It also means that you can’t use good old Markdown for your links (unless you’re using one of a handful of ‘flavours’ of Markdown, like Kramdown). I’ll put it right out there: this is arduous. Getting every link to open in a new tab can be done by hand or programmatically. Let’s say we’re going to go for it: in design, consistency is important, so every external link should open in a new browser tab.įirst, we have to consider the implementation, and then there are the user experience implications. instead of repeating “tab or window” for ease of reading, but also because opening in a new tab, rather than window, is the default behaviour for most web browsers. Their rationale is that it keeps users on their website (blog, digital product, etc.) but, as with most things in web design, it’s not as simple as it seems.

    when i click on a link it opens two tabs

    I’ve had several very similar conversations with clients and stakeholders over the years about opening links to other websites in a new tab or window.












    When i click on a link it opens two tabs