views:

125

answers:

1

Hi,

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');"&gt;Enroll&lt;/a&gt;

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

+2  A: 

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.

oedo
That's not a JavaScript solution though.
Kinopiko
Hi thanks for replying but the problem remains in internet explorer its still opening in a new popup
Pankaj Khurana
@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.'
oedo
@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?)
oedo
hi i have ie8 version
Pankaj Khurana
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.
oedo
But, relying on the end-user's browser settings is not a good idea, unless you are developing an application for internal use, and you are able to ensure that all users have their browsers configured in the same way. Unpredictable behaviour is a sure-fire way to alienate users.
belugabob