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

后端 未结 3 1427
孤街浪徒
孤街浪徒 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:37

    You cannot specify to open in a 'new tab', but if you have a tabbed browser this behavior is configurable. For example, I believe Firefox has this behavior by default

    See Tools -> Options -> Tabs -> check "open new windows in a new tab instead"

    The following JavaScript will work a charm for you

    
    

提交回复
热议问题