admin管理员组文章数量:1430020
Using this below code I am able to open new tab along with the URL..in Firefox..but same code when I am trying to open in Chrome its opening new window which I don't want new window ..I want new tab in case of chrome
Here is my code:
> window.open(this.getJavaURL +
((this.returnPage != null) ?
('&returnPage=' + this.returnPage) : '') +
((this.locale != null) ?
('&locale=' + this.locale) : '') +
((this.brand != null) ?
('&brand=' + this.brand) : ''),'_new');
Can you please help me..
Using this below code I am able to open new tab along with the URL..in Firefox..but same code when I am trying to open in Chrome its opening new window which I don't want new window ..I want new tab in case of chrome
Here is my code:
> window.open(this.getJavaURL +
((this.returnPage != null) ?
('&returnPage=' + this.returnPage) : '') +
((this.locale != null) ?
('&locale=' + this.locale) : '') +
((this.brand != null) ?
('&brand=' + this.brand) : ''),'_new');
Can you please help me..
Share Improve this question edited Jun 27, 2013 at 9:46 Pranav Singh 20.2k32 gold badges83 silver badges108 bronze badges asked Jun 27, 2013 at 9:34 ManojManoj 111 gold badge1 silver badge3 bronze badges 4- 1 Instead of "_new", you can use "_newtab" – knshn Commented Jun 27, 2013 at 9:38
- I tried with that but still i am getting the new window.. – Manoj Commented Jun 27, 2013 at 9:42
- 2 This depends on the browser settings, you can't probably change this: stackoverflow./a/4907854/1935077 – Petr R. Commented Jun 27, 2013 at 9:55
- possible duplicate of Open url in new tab using javascript – sra Commented Dec 3, 2013 at 10:01
4 Answers
Reset to default 0It's work for me. Just
window.open('http://google.');
http://jsfiddle/HFeQj/
Wether a new window or new tab is openend is based upon your browser configuration, within the browser you can set to always open popups in new tabs.
_new might break it and always open a window, _blank is the way to go like Satpal says
Use _blank
instead of "_new"
It will instruct the browser to create a new browser tab or window when the user clicks on the link.
As per reference: _new is not valid
Demo: http://jsfiddle/eH9tw/
it is depends on chrome
and firefox
tab setting.
For open new tab, you can write as below:
window.open('http://google.');
if new tab set as new window then it will open in new window, else it will open in new tab.
本文标签: javascriptHow to open new tab instead of new window in Chrome in java scriptsStack Overflow
版权声明:本文标题:javascript - How to open new tab instead of new window in Chrome in java scripts - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745498683a2660928.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论