javascript - Opening url in new tab - Stack Overflow

I am trying to open a new tab with javascript.How to write it so that it would work in chrome, firefox

I am trying to open a new tab with javascript.
How to write it so that it would work in chrome, firefox and IE7?
(the pages are on the same domain)

UPD: Let's presume that the user uses the default configuration of IE7...

I am trying to open a new tab with javascript.
How to write it so that it would work in chrome, firefox and IE7?
(the pages are on the same domain)

UPD: Let's presume that the user uses the default configuration of IE7...

Share Improve this question edited Jul 9, 2011 at 21:05 lvil asked Jul 9, 2011 at 20:57 lvillvil 4,3269 gold badges51 silver badges78 bronze badges
Add a ment  | 

2 Answers 2

Reset to default 8

You cannot control how the browser will handle opening new popups / pages. This is entirely handled by the browser. If the user has set their browser up to open new pages/popups in a new window, you cannot force your own page to open in a tab.

Plain HTML:

<a href="newpage.html" target="_blank">click here</a>

Javascript:

window.open("newpage.html", "_blank");

But keep in mind what psynnott said.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745416884a4626789.html

相关推荐

  • javascript - Opening url in new tab - Stack Overflow

    I am trying to open a new tab with javascript.How to write it so that it would work in chrome, firefox

    6小时前
    40

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信