The thing is — if you have links with target="_blank" and you have handler for click on this link that makes window.open(), then pop window that was called with JS will be shown, but the link will be not open in new tab in IE (9 version was tested for sure), it will be blocked by IE popup blocker.
All other browsers open both — a link in new tab and a pop window. Any workaround?
Asked
Active
Viewed 5,823 times
2

elisium
- 308
- 1
- 5
- 14
-
can you post some sample code? Not 100% following your description... – Brian Aug 02 '11 at 17:01
-
I think he wants to implement his own "link opener" with window.open. – ComFreek Aug 02 '11 at 17:07
-
The sample you can find in 1 answer. Yes, I want to open both. – elisium Aug 03 '11 at 08:34
-
1@elisium: Why would you want that? – Eric Aug 03 '11 at 17:27
-
This is a task. As for me — I don't want such behaviour on sites I use. – elisium Aug 04 '11 at 12:09
1 Answers
1
As you said, Chrome allows this while IE9 blocks this behavior by default (fiddle). However, this seems like a perfectly legitimate response from a pop-up blocker. I doubt most users would (or should have to) expect that a hyperlink will open two new windows simultaneously.
That said, your users can certainly change their pop-up blocker settings for IE in order to allow pop-ups from your site.
[Update]
Testing with a timeout on the window.open(), it appears that it's certainly the second window which is suppressed regardless of whether it's the link's href or the result of the window.open() (fiddle).

canon
- 40,609
- 10
- 73
- 97
-
I think, than normal behavior is to block pop window, not link opening (even with target _blank). And, unfortunately, force users to change popup blocker is not good choice and not resolving the problemm. If IE blocked the pop window — I couldn't say it's not normal. – elisium Aug 03 '11 at 08:37
-
You say that, but your click handler, _window.open()_, is processed before the browser navigates to the href... so, it may just be that any windows opened beyond the first are treated as pop-ups to be suppressed. – canon Aug 03 '11 at 13:12
-
I understand that, but how can any browser treat regular link opening as popup, in any case. Anyway I need a way to force opening both links. – elisium Aug 03 '11 at 13:50