Forum Moderators: open

Message Too Old, No Replies

Popup windows fail to open in IE7

         

arachnoid

9:10 pm on Sep 5, 2007 (gmt 0)

10+ Year Member



I've come across a problem with calling popup windows in IE7. Every other browser I've tested this on, on both Mac and PC platforms, works. (That's IE6, Firefox, Netscape, Opera, Safari, Camino). I've tried turning off the popup blocker in IE7 but it seems to make no difference. I'm running IE7 in a standalone implementation from Yousef Al Saif's Multiple IE installer, so it's conceivable that it's not behaving like a kosher installation, but can anyone tell me if they've come across this problem? And if they have, if there's a solution?

I use the following code to initiate popup windows from a clicked icon on the site.

<a href="item_pop.htm" onclick="popUp(this.href,'console',495,720);return false;"><img src="iconimage.gif" alt="icon" width="50" height="55" /></a>

The Javascript is contained in a .js file which is called immediately after the <body> tag. The Javascript is:

var newWin = null;
function popUp(strURL, strType, strHeight, strWidth) {
if (newWin!= null &&!newWin.closed)
newWin.close();
var strOptions="";
if (strType=="console")
strOptions="resizable,height="+
strHeight+",width="+strWidth;
if (strType=="fixed")
strOptions="status,height="+
strHeight+",width="+strWidth;
if (strType=="elastic")
strOptions="toolbar,menubar,scrollbars,"+
"resizable,location,height="+
strHeight+",width="+strWidth;
newWin = window.open(strURL, 'newWin', strOptions);
newWin.focus();
}

DTD XHTML 1.0 Strict. Code all validates.

Marshall

9:37 pm on Sep 5, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Do you, per chance, have a 'G' toolbar, or one similar, that blocks pop-ups?

Marshall

arachnoid

10:03 pm on Sep 5, 2007 (gmt 0)

10+ Year Member



Just whatever comes attached to a bare bones installation of IE7 ... I'm not very familiar with it -- only use it on an old PC laptop for testing sites ... there's a "Live Search", whatever that is, set as default. I found the popup blocker seting in Internet Options and turned it off and, as mentioned, it makes no difference.

But it could easily be this particular setup that's responsible. Since AFAIK the code functions fine in any other browser, if nobody can see any reason why it shouldn't function in IE7, then I'll not lose any sleep over it until I get around to visiting someone with a "proper" installation of it to confirm.

penders

11:21 pm on Sep 5, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



What actually happens? Do you simply get nothing? Any errors? Any indication that a popup has been blocked?

Is the popup opened, but as a new tab?

Which 'zone' are you running in... 'internet' or 'local intranet'? Certainly your popup won't work in the local zone without a 'mark of the web', as by default it doesn't allow active content (ie. JavaScript) - but then neither would IE6.

arachnoid

11:42 pm on Sep 5, 2007 (gmt 0)

10+ Year Member



All that happens is that the blue program title bar of the IE7 window changes to non-focus display and the options on the main toolbar similarly become greyed out. No new tab/window opens (which it would normally do if Javascript was disabled). No error messages.

I'm running in "internet" zone.

Marshall

7:09 am on Sep 6, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



arachnoid. Something to consider: use a hidden <div> that is visible on body load that hides when people close it. I do this to get around pop-up blockers, but I make sure the information is important and not spamish/annoying.

Marshall

arachnoid

9:40 am on Sep 6, 2007 (gmt 0)

10+ Year Member



Thanks for the suggestion, Marshall. I use hidden divs elsewhere in the site, but popups here are just the ideal solution. They hold images of garden plans in the portfolio section of a landscape designer's site. To be large enough to get a decent idea of them, the images need to be around 700px wide so using hidden divs here would require some major adjustments to the 2-column div layout. Since most popup blockers I've come across won't block a deliberately actioned popup, I preferred this solution.

Searching for previous posts on this issue, I came across a rumour pre-IE7 release that IE7 was going to implement some fairly stringent popup blocking, but then a response from someone saying they could hardly do that with the amount of popup use (a lot of it legitimate) out there. That made sense, so I wasn't anticipating problems.

I still think (hope!) it's this standalone implementation of IE7 that's not behaving. And I was hoping to avoid having to set up a separate Windows VM on the Mac just for IE7 ...

penders

1:16 pm on Sep 6, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



All that happens is that the blue program title bar of the IE7 window changes to non-focus display and the options on the main toolbar similarly become greyed out.

That does sound a bit odd - it's as if the last line of your script ( newWin.focus()) is being actioned - but where o where has the window gone? IMO, it does suggest it's being blocked somehow?

I have certainly used popups in a similar fashion on IE7 without a problem, as like you say, popups as the result of a direct user action are usually OK.

However, others have had problems with popups on IE7. Possibly a browser configuration?!

arachnoid

9:23 am on Sep 7, 2007 (gmt 0)

10+ Year Member



That does sound a bit odd - it's as if the last line of your script ( newWin.focus()) is being actioned - but where o where has the window gone? IMO, it does suggest it's being blocked somehow?

That's what I thought, which is why I turned the popup blocker off. Can't figure why that should make no difference on a plain vanilla installation unless it's not behaving the way it's supposed to. There's nothing on this PC apart from Windows XP (with IE6) and all the various other Windows browsers installed as they come with nothing -- no toolbars, no extensions -- added. However, not all the Multiple IE versions work, so it may be that IE7 is compromised too.

wakeboarder801

3:07 pm on Sep 14, 2007 (gmt 0)

10+ Year Member



I am having the exact same problem. Any time I try to open a window involving javascript, it immediately closes.

I am running ie7 on windows vista

penders

2:21 pm on Sep 15, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



And I presume (with JavaScript error reporting enabled) there are no JS errors reported...? There are no 'permission' errors reported? And neither does IE7 report that any popup window has been blocked? And the same popup window works perfectly OK on IE6 and all other browsers?

If popups are proving to be even less reliable than before for what appears to be reasons unknown then their usefulness in real world scenarios is going to decline even more...

Hhhmmm, I just had another thought... there are quite a few spyware, adware, malware scanners, blockers and monitors. Some of these do work very closely with the browser to prevent malware attacking your machine as it strikes. Is it possible that this software (although not strickly a popup blocker) could be the cause of IE7 failing to 'popup'?!