2

Possible Duplicate:
Opening url in new tab

while i am doing window.open(),my page opended in new window,but i want it to be opened in newtab of my browser. How can do that?

6
  • 1
    You cannot control it, it depends on the browser settings.
    – Viruzzo
    Feb 7, 2012 at 11:45
  • you can use anchor tag to open in new tab.Have you tried that?
    – Kiran
    Feb 7, 2012 at 12:01
  • @Matrix what will be the target attribute value?
    – BOSS
    Feb 7, 2012 at 14:35
  • target will be _new it will work if you use anchor tag :-)
    – Kiran
    Feb 8, 2012 at 2:47
  • @Matrix Tried with <a href="Sample.html" target="_new">Your link</a> Not working.
    – BOSS
    Feb 8, 2012 at 7:02

1 Answer 1

3

I'm 99% sure you can't. There might always be an exception for the Redmond browser, but for the rest in the browser-land you cannot affect how a new window is opened via ECMAscript (which is a good thing).

It's a browser setting.

3
  • It is possible. Twitter does it. All external links that appear within tweets are opened in a new tab - this works cross-browser (including IE8). Not sure how they do it, have to check. Mar 5, 2013 at 13:03
  • @ŠimeVidas: would be pretty interresting
    – jAndy
    Mar 5, 2013 at 13:18
  • I guess it depends on the OS. I just tried window.open( 'http://google.com', '_blank' ) - it opens the URL in a new tab in all browsers. (I also tried IE8 mode in IE10) Mar 5, 2013 at 13:25

Not the answer you're looking for? Browse other questions tagged or ask your own question.