Open a New Browser Tab With JavaScript

I just came across this entry over at Larry Williams’ Blog explaining how to open a link in a new tab. Pretty interesting, and kudos to Larry for figuring this out. It just seems to me that there should be a way to do with without JavaScript. Wouldn’t that be more usable?

I mean, there are special names to use in the target to do things such as open a new window (_blank), open in a parent window (_parent), etc. IE and Mozilla also provide the _search value to open links in the search sidebar. Wouldn’t it make sense for Mozilla to support a value like _tab to open a link in a new tab? That way, it would fail gracefully in non-supporting browsers by opening a new window instead.

Master JavaScript Promises

Free E-book - Understanding JavaScript Promises

What You'll Learn

  • Promise fundamentals and concepts
  • Real-world promise implementations
  • Best practices and patterns
  • Error handling techniques

Demystify JavaScript promises with practical examples and expert insights.

Download Your Free Copy

The community edition arrives in your inbox within minutes.