开发者

Opening url in new tab

开发者 https://www.devze.com 2023-03-18 07:25 出处:网络
I am trying to open a new tab with javascript. How to write it so that it would work in chrome, firefox and 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...


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.

0

精彩评论

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