1

I have a page in which i have provided a link clicking on which should redirect to a new page on the new window.

My code is

<a href="javascript:void(0);" class="webMnu" onclick="window.open('http://abc.com','plain');">Enroll</a> 

The problem is that it is working fine in firefox(opens in a new tab) but in internet explorer its opening in a popup (not in a new tab).

How can i open this new page in new tab?

Please help me on this.

Thanks

Pankaj

5
  • 1
    As far as I know this isn't possible; it is a user preference in the browser whether to make a new window or a new tab, and if the user doesn't set the preference in Internet Explorer, it opens a new window. Commented Apr 12, 2010 at 8:48
  • 2
    window.open will always attempt to open a popup window, target=_blank will attempt to open a 'normal' window/tab. of course if the user has configured these differently then they'll act differently :) Commented Apr 12, 2010 at 8:51
  • Correct - You cannot force a link to open in a new tab in IE. It's down to user preferences. Commented Apr 12, 2010 at 8:53
  • sorry my (slight) bad, it seems ie8's default behaviour is different, see my comment on my answer below :P Commented Apr 12, 2010 at 8:54
  • User preferences my ass. If it's down to user preferences, they why are we allowed to tell the browser to open a new window!? Commented Oct 3, 2010 at 1:53

1 Answer 1

5

you want

<a href="http://abc.com" target="_blank">Enroll</a> 

window.open is for popup windows, if you just want a new browser window/tab, target=_blank is your friend.

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

6 Comments

That's not a JavaScript solution though.
Hi thanks for replying but the problem remains in internet explorer its still opening in a new popup
@kinopiko why does it need to be? the requirement was 'I have a page in which i have provided a link clicking on which should redirect to a new page on the new window.'
@pankaj, which version of ie? that code should open in a new window (which means tab for modern browsers, unless you've configured it differently?)
have a look under Tools > Internet Options > General > Tabs [Settings] > "Always open pop-ups in a new window" (selected by default), "Always open pop-ups in a new tab", or "Let Internet Explorer decide how pop-ups should open" which is the one you want.
|

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.