469,356 Members | 1,873 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,356 developers. It's quick & easy.

multiple calls to window.open not succeeding in IE

I have a situation where I need to respond to a link click by opening 2
windows and navigating to a URL in the parent window. Here's the
function I invoke:

function handleOfferLink(selfURL, instructionURL, offerURL)
{
window.open(selfURL, '_self').focus();
window.open(offerURL, '_blank').focus();
window.open(instructionURL, '_blank',
'width=435,height=390,top=0,left=0').focus();
return 0;
}

This code is invoked as a direct result of the user clicking a link
(href). On FireFox (FF) I get totally expected behavior: both windows
open and the parent window navigates to selfURL, however on Internet
Explorer (IE), something interesting happens: the first call to open a
new window succeeds, while the second is blocked. If I swap those 2
lines around, instructionURL opens, while offerURL does not. I've
tried taking out the dimension specs and everything else you could
think of it. It just looks like IE doesn't wanna allow more than 1
popup at a time, even if it's in response to a user action. I can't
seem to find a good guideline to IE's popup blocker. Any advice?

Jun 2 '06 #1
4 1975

Alexey wrote:
I have a situation where I need to respond to a link click by opening 2
windows and navigating to a URL in the parent window. Here's the
function I invoke:

function handleOfferLink(selfURL, instructionURL, offerURL)
{
window.open(selfURL, '_self').focus();
window.open(offerURL, '_blank').focus();
window.open(instructionURL, '_blank',
'width=435,height=390,top=0,left=0').focus();
return 0;
}

This code is invoked as a direct result of the user clicking a link
(href). On FireFox (FF) I get totally expected behavior: both windows
open and the parent window navigates to selfURL, however on Internet
Explorer (IE), something interesting happens: the first call to open a
new window succeeds, while the second is blocked. If I swap those 2
lines around, instructionURL opens, while offerURL does not. I've
tried taking out the dimension specs and everything else you could
think of it. It just looks like IE doesn't wanna allow more than 1
popup at a time, even if it's in response to a user action. I can't
seem to find a good guideline to IE's popup blocker. Any advice?

By calling: window.open(selfURL, '_self') first, I would suspect that
the script is being dismissed before it can complete. Is it OK to call
it last?

Jun 2 '06 #2

Stephen Chalmers wrote:
By calling: window.open(selfURL, '_self') first, I would suspect that
the script is being dismissed before it can complete. Is it OK to call
it last?


That's a valid point and I've considered it. I don't believe that is
the cause of the problem for 2 reasons:

1. I do see other lines executing after that line, so it's not as
though JS execution on that page is halted as soon as I make a call
window.open(selfURL, '_self').

2. In one of my tests, I've commented that line out and saw no change
in behavior.

Jun 5 '06 #3

Alexey wrote:
Stephen Chalmers wrote:
By calling: window.open(selfURL, '_self') first, I would suspect that
the script is being dismissed before it can complete. Is it OK to call
it last?


That's a valid point and I've considered it. I don't believe that is
the cause of the problem for 2 reasons:

1. I do see other lines executing after that line, so it's not as
though JS execution on that page is halted as soon as I make a call
window.open(selfURL, '_self').

2. In one of my tests, I've commented that line out and saw no change
in behavior.


Have you eliminated the popup blocker by disabling it?

Jun 5 '06 #4

Stephen Chalmers wrote:
Have you eliminated the popup blocker by disabling it?


I'm sorry, I don't quite understand. If I disable the popup blocker in
the browser, the popups work fine. I'm trying to get this to work for
people who've not taken that step. Does that answer the question?

Jun 6 '06 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

7 posts views Thread by Evan Kontos | last post: by
3 posts views Thread by Voetleuce en f?nsievry | last post: by
7 posts views Thread by anthony.turcotte | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
1 post views Thread by Marylou17 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.