Gary Bell

Navigation

Skip navigation.

Search

Site navigation

Email conversation

FromGary Bell
ToMe
SubjectGetting a page error warning in IE7
Date29 December 2006 01:46
Hello Tarquin,

I have a couple of questions regarding the Perfect Popup Script. I am seeing
a page error warning in IE7 when the popup image renders. The details of the
error state: 'scW' undefined.
Is there a good way to remedy this?

Also I get a blank "page error" window that pops before the image renders.
Any cure for this as I believe it logs in our server logs as an error?

A URL test link can be found at:
[URL]

Best regards,
Gary Bell
FromMe
ToGary Bell
SubjectRe: Getting a page error warning in IE7
Date30 December 2006 00:05
Gary,

> The details of the error state: 'scW' undefined.

Your copy of the code is missing the following two lines:
'var scW = screen.availWidth ? screen.availWidth : screen.width;\n'+
'var scH = screen.availHeight ? screen.availHeight : screen.height;\n'+

See the following page for details of where those two lines are needed:
http://www.howtocreate.co.uk/perfectPopups.html

> Also I get a blank "page error" window that pops before the image renders.

Your copy of the code has a mistake in the line that opens the popup. The
line that starts like this:
var imgWin = window.open(' ',...
should start like this:
var imgWin = window.open('',...
Browsers treat the empty URL specially when opened from JavaScript; the new
page thinks it has the same URL as the page that opened it, and there will
not be any attempt to load a new page from the server.


Mark 'Tarquin' Wilton-Jones - author of http://www.howtocreate.co.uk/
FromGary Bell
ToMe
SubjectRe: Getting a page error warning in IE7
Date30 December 2006 01:46
Thank you for your rapid response.

I remove the two lines in an attempt to not have the popup window center. It
was doing this in IE. I kept the 'if( !window.opera ) line thinking it was
required by that browser.

The reason I placed a space between the '' marks was to have a title on the
screen other than about:blank. Without the space and with changing the
'_blank' to 'someTitle' it would render the page without opening a new page.

I have changed the example URL back to include the two lines.

Aafter I corrected the code I still get the "false" page popping.

Best regards,
Gary
FromMe
ToGary Bell
SubjectRe: Getting a page error warning in IE7
Date1 January 2007 17:42
Gary,

> I remove the two lines in an attempt to not have the popup window center. It
> was doing this in IE. I kept the 'if( !window.opera ) line thinking it was
> required by that browser.

Exactly the opposite :) It is used by all _except_ that browser (the !
operator is a negative check). Remove that line, as well as the two above it
that you just put back, and it will do what you want.

> The reason I placed a space between the '' marks was to have a title on
> the screen other than about:blank.

This is a strange behaviour in IE 7. The address bar says 'about:blank'
while the script sees the source address (like it should). In fact, I think
it is a bug deliberately used as a workaround for a security problem they
used to have. I do not know any proper workaround for it - I think you may
have to simply accept it as it is. Other browsers are more sensible.
FromGary Bell
ToMe
SubjectRe: Getting a page error warning in IE7
Date1 January 2007 18:34
Many Thanks. Happy New Year.
GVB
This site was created by Mark "Tarquin" Wilton-Jones.
Don't click this link unless you want to be banned from our site.