I have the following JavaScript code to pop up a window in Internet Explorer. The code is executed from a page within a Microsoft CRM modal dialog box. (RequestID is a string that is always the same in the test system – at the moment it contains ‘abcdefg’ – without the quotes).
var cancelUrl = 'CancelRequest.aspx?RequestID=' + RequestID; alert('About to open a window.\n\n' + cancelUrl); window.open(cancelUrl); alert('Window opened');
I expect to see a message telling me that I am about to open a window. I then expect to see a window open and get another message about the window having been opened. I don’t really care about the order of the last two events; the alerts are there so I know the code has been executed.
I have two PCs and a virtual PC. All running IE7. On the Windows 2003 VPC, the messages and pop-up appear every time without fail.
On the Vista PC and WinXP PC, the messages appear but the pop-up only appears intermittently. (I think this may be the case on the Vista PC too).
All three have identical settings in IE. All have the IE pop-up blocker disabled and have no other pop-up blockers installed.
Can anyone shed any light on this?
Ah, I think I got it… missed it in the description…
You are trying to open a non-modal window from a modal dialog in IE.
This AFAIK, should not work.
Try opening another modal window instead.
Effectively you are saying…
on window A, open up modal window B, now open up non-modal window C, which isn’t really valid.