Monday, December 4, 2023
 Popular · Latest · Hot · Upcoming
rated 0 times [  75] [ 7]  / answers: 1 / hits: 62342  / 15 Years ago, wed, may 20, 2009, 12:00:00

Can anyone help, I have a popup that is being blocked. It is a popup that is created because somebody has clicked on a Print picture on my site.

I thought IE is not supposed to block these when the popup came via an onclick?

Can anyone help? The child1 variable is always returned as NULL if popup blocker enabled...

Maybe the problem is that the onclick event then passes control to a new function which loads a html file and does child.document.write

Here is my simple code..

var width = 800;
var height = 600;
var left = parseInt((screen.availWidth / 2) - (width / 2));
var top = parseInt((screen.availHeight / 2) - (height / 2));
var windowFeatures = width= + width + ,height= + height
+ ,menubar=yes,toolbar=yes,scrollbars=yes,resizable=yes,left=
+ left + ,top= + top + screenX= + left + ,screenY= + top;

child1 =, subWind, windowFeatures);

More From » popup


The problem will be that open will only return a reference to the window if you are navigating to somewhere within your current host. You are navigating to about:blank which is not within your host.

Try adding a blank.htm file to your site and open that instead. I'm still not sure that document.write will be allowed the document won't be open for write, you may be able to manipulate the DOM of the existing blank document though.

[#99492] Saturday, May 16, 2009, 15 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.

Total Points: 616
Total Questions: 110
Total Answers: 101

Location: Andorra
Member since Sat, May 27, 2023
7 Months ago