Picture of Paul Silver

Paul Silver

Making websites for companies and helping advertise them

Requested pop-up that won't be blocked

There are many pop-up blockers on the market which will stop annoying adverts from automatically opening when you go to or exit web pages. Unfortunately, some of them also block requested pop-ups which you actually want, such as small windows for applications.

Google toolbar is a popular addition for Internet Explorer which is over-aggressive in blocking any pop-ups, whether they are started automatically or by the visitor clicking a link to request it. Someone on a forum I read recently found this was blocking an intranet application his company used internally. With the Google toolbar it is possible to allow certain websites to send pop-ups through, but there is no easy way to roll out the change to the whole company and he felt his users were too non-technical to follow the instructions of how to change the behaviour considering their browsers were set up in various ways.

Instead, I suggested a different way of creating the pop-up window. This method uses the 'target="_new"' command to create a new browser window, then code on the page opened to re-size the window to what is required. This is not as elegant as creating the pop-up at the right size immediately, but does work and requires no changes to the visitor's browser or blocking settings.

First, set up a link which will spawn a new window:

<a href="testpopup.html" target="_new">click here for popup</a>

Then on the page (testpopup.html) put the following script between the <head></head> tags:

<script>
window.resizeTo(500,300);
</script>

This re-sizes the window to the set dimensions. '500' is the width of the window, '300' is the height.

This method means there is a short delay while the window is the same size as the originating window, but it does re-size to whatever you want to set it, and doesn't get blocked, which is what's required.

Give it a test here:

Click here for popup

More code articles

Useful books
Cover of Don't Make Me Think
Usability: Don't Make Me Think
Amazon UK | USA
Cover of Web Redesign Workflow That Works
Web Redesign Workflow
That Works
Amazon UK | USA
Cover of Information Architecture Handbook
Information Architecture Handbook
Amazon UK | USA

Paul Silver. March 2004.

© 2024 Paul Silver & Silver Web Services Ltd