TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

What did Substack do to make all links open in new tab?

2 pointsby jdcampolargoalmost 3 years ago
how can you make a website open all links in a new tab?<p>Maybe not all but most of them like those in blogs.<p>Thanks for your help.

3 comments

thewarpaintalmost 3 years ago
May I suggest to post this question on a forum better suited to these kind of submissions, like Stack Overflow?<p>This is probably what you’re looking for: <a href="https:&#x2F;&#x2F;developer.mozilla.org&#x2F;en-US&#x2F;docs&#x2F;Web&#x2F;HTML&#x2F;Element&#x2F;a#attr-target" rel="nofollow">https:&#x2F;&#x2F;developer.mozilla.org&#x2F;en-US&#x2F;docs&#x2F;Web&#x2F;HTML&#x2F;Element&#x2F;a#...</a>
jethronethroalmost 3 years ago
Knowing Substack, they might have used the JavaScript window.open() method to do that. But adding target=&quot;_blank&quot; to a URL (e.g. &lt;a href=&quot;<a href="https:&#x2F;&#x2F;somesite.net" rel="nofollow">https:&#x2F;&#x2F;somesite.net</a>&quot; target=&quot;_blank&quot;&gt;blah blah blah&lt;&#x2F;a&gt;) also works if you want to go the no-script route
ubermanalmost 3 years ago
<i>target=&quot;_blank&quot;</i>?