View Full Version : Opening new windows

06-05-2004, 12:42 PM
I want to open a link in a new window but I want to size the window & take away scrollbars etc etc .. is there a way to do this without it getting blocked by popup stoppers?

I have working code for this now but I'm thinking it will get blocked by popup stoppers.... all I need is a custom sized window to open when a user clicks a link without it getting blocked by popup stoppers.

Any help?


06-05-2004, 01:18 PM
I'm afraid the whole idea behind pop-up blockers is to block pop-ups. As what you are wanting to do is to open a pop-up, I'm afraid you're going to find life difficult (for difficult, read "impossible"). After the code to open your pop-up you could put in something like;

if(!pop-upwindowname){alert("Your PC does not appear to be allowing a pop-up window to open, possibly because you are using software to block unwanted pop-ups. This page will display, but unless you disable your pop-up blocker software temporarily, you may lose functionailty, or be unable to access features on this page.\n\nThe software might be bypassed by pressing and holding the 'Ctrl' key whilst clicking on hyperlinks or buttons that open new windows.")}

06-05-2004, 01:59 PM
Hmmmm..... well I just downloaded & installed one of the most popular popup blockers to see if it blocked the current way I am doing it & it didn't block it heh

The code I am using in the <head> </head> tags is..

<!-- Begin
function popUp(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=600,height=225,left = 200,top = 64');");
// End -->

Then in the link:

<a href="javascript:popUp('select.html')" >


06-05-2004, 03:46 PM
That's because pop-up blockers aren't perfect. You'll find that most block some of the pop-ups some of the time, while a very few block most pop-ups most of the time, however none block all of the pop-ups all of the time. If the one you're using doesn't block your particular pop-up, don't bank on every visitor to your website using the same program.

06-05-2004, 04:11 PM
Good Advice! :D

06-05-2004, 06:45 PM
with my PUB, when i click a link twice it will pop-up the second time.
try making a link that makes the same window apear twice
...though that may be innoying for people withput PUBs

06-07-2004, 07:18 AM
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=600,height=225,left = 200,top = 64');");
The eval statement is not necessary. Search this forum for eval and you'll find that it is evil :D
If you want a dynamic global variable, you can use this technique:

window["page" + id] = window.open(URL, id, 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=600,height=225,left=200,t op=64');