How can I open a new browser tab from within JavaScript?

后端 未结 3 1432
孤街浪徒
孤街浪徒 2020-12-21 13:07

How do I write a JavaScript function that opens a new browser tab at a specified URL? I know how to do this in In HTML using a link with target=\"_blank\", but in my case I

3条回答
  •  情书的邮戳
    2020-12-21 13:44

    You can't. Javascript has no built-in support for tabs, because not all Javascript capable browser have tabs at all (think IE6). You can at most open a new window (though that might get pop-up blocked of course).

    Some browsers might show those new windows as tabs. I believe Opera does this.

提交回复
热议问题