Javascript 如何在java脚本中打开新的选项卡而不是Chrome中的新窗口

Javascript 如何在java脚本中打开新的选项卡而不是Chrome中的新窗口,javascript,cross-browser,Javascript,Cross Browser,使用下面的代码,我可以在Firefox中打开新标签以及URL。但是当我试图在Chrome中打开它的新窗口时,我不想要新窗口。我想要在Chrome中打开新标签 这是我的密码: > window.open(this.getJavaURL + ((this.returnPage != null) ? ('&returnPage=' + this.returnPage) : '') +

使用下面的代码,我可以在Firefox中打开新标签以及URL。但是当我试图在Chrome中打开它的新窗口时,我不想要新窗口。我想要在Chrome中打开新标签

这是我的密码:

> window.open(this.getJavaURL +
                        ((this.returnPage != null) ?
                        ('&returnPage=' + this.returnPage) : '') +
                        ((this.locale != null) ?
                        ('&locale=' + this.locale) : '') +
                        ((this.brand != null) ?
                     ('&brand=' + this.brand) : ''),'_new');

你能帮我吗?

\u blank
代替“\u new”

当用户单击链接时,它将指示浏览器创建新的浏览器选项卡或窗口

根据:\u new无效

演示:

这是我的工作。只是

    window.open('http://google.com');   

是否打开新窗口或新选项卡取决于您的浏览器配置,您可以在浏览器中设置为始终打开新选项卡中的弹出窗口


_new可能会破坏它并总是打开一个窗口,就像Satpal说的那样,blank是一种方式,这取决于
chrome
firefox
选项卡设置

对于“打开新选项卡”,您可以编写如下内容:

 window.open('http://google.com');

如果新选项卡设置为新窗口,则它将在新窗口中打开,否则它将在新选项卡中打开。

您可以使用“\u newtab”而不是“\u new”,我尝试过使用它,但仍然获得了新窗口。这取决于浏览器设置,您可能无法更改:可能重复最佳回答周期_空白实际上导致了问题。刚把它取下来,它就起作用了。