1

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...

2 Answers 2

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.

Sign up to request clarification or add additional context in comments.

2 Comments

Updated the question (if it really matters)
It doesn't matter what the configuration of the browser is. You can't alter it / find out what it is. So, you won't be able to be 100% certain what a javascript window.open will do (or html target="_blank" - see ZippyV's answer below) - whether it will open a tab or if it will open a new window.
1

Plain HTML:

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

Javascript:

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

But keep in mind what psynnott said.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.