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.

Why you shouldn’t use target=_blank, and what to use instead

1 pointsby jaladaover 14 years ago

2 comments

Sidniciousover 14 years ago
Even if it were deprecated, I would probably keep using target="_blank" it as long as it worked.<p>I feel that an attribute that says, "Hey, web browser, it would be great if you opened this thing in a new window, tab, or whatever" is fundamentally superior to binding some JavaScript code to the link's click handler.
评论 #2204359 未加载
jaladaover 14 years ago
OK so it's been pointed out to me that HTML5 didn't deprecate target=_blank like I thought. It was just XHTML that removed it, and my method uses HTML5 'data-' attributes. So it's pretty irrelevant, just carry on using target=_blank I guess?