简体   繁体   English

如何在启用了选项卡的新窗口中打开链接

[英]How to open a link in new window with tab enabled

I search a lot but could not figured it out. 我搜索了很多,但无法弄明白。

Is it possible to open a new window with tab enabled using window.open() method?. 是否可以使用window.open()方法打开一个启用了tab的新窗口? The way chrome context menu "open link in new window" works. Chrome上下文菜单“在新窗口中打开链接”的工作方式。

The browser decides on its own how links will open. 浏览器自行决定链接的打开方式。 Sometimes a user can configure how links are to be opened, but the web page cannot do this. 有时,用户可以配置如何打开链接,但网页无法执行此操作。

using an anchor tag you can set the target attribute to have some control over where the link opens. 使用锚标记 ,你可以设置target属性有超过链接打开其中一些控制。 Other than that, this behavior is up to the browser and user and cannot be controlled by javascript. 除此之外,此行为取决于浏览器和用户,并且无法通过javascript控制。

使用此代码

window.open("http:.//www.google.com","DemoName",'scrollbars=1,height=650,width=1050');

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM