Forum Moderators: open
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.
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.
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.
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 ...
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?!
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.
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'?!