开发者

How do you open a new tab in chrome using HTML/JS?

开发者 https://www.devze.com 2023-02-21 03:12 出处:网络
I tried this code window.open(\'page2.开发者_Python百科html\',\'_newtab\'); And all it opened was a new window. How do I open a new tab?This is a browser setting and not something you can control wi

I tried this code

window.open('page2.开发者_Python百科html','_newtab');

And all it opened was a new window. How do I open a new tab?


This is a browser setting and not something you can control with code. In my browser, your "window.open" will open a new tab, because that's what I have mine set up to do. In others' browsers, it might open a new window.


You can do this easily. See the answer here.


I don't think you can, from HTML / Javascript, indicate that a page should be opened in a new tab.

(In fact, your page might be opened to a new window, or to a new tab, depending on the configuration of the browser)

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号