View Full Version : Need Break Out of Pop-Up Script

04-24-2005, 09:21 PM
Thanks for your help ....

I can't find a script to do what I thought was a relatively basic function. Here's my problem .....

I'm calling a pop-up window from a hyperlink on my home page. Once the pop-up window appears, the user will either decide to close it or click-through to a new page.

I've been unable to find a script that is specifically coded to break-out of apop-up and load a new page into the original browser session that displayed my home page. Ideally, I also need this script to automatically close the pop-up window when the user decides to click-away to the new page.

I've tried to modify a number of scripts designed to break out of a frame, but none work - they all load the new page back into the pop-up window.

Appreciate your help.


Doug C.

04-25-2005, 06:31 AM
There is a security issue here. Don't ask me why but Microsoft, in its infinite wisdom, has decided that a window closing itself is a bad thing so, unless it is a fresh instance of a window and leads the user nowhere, closing it using the widow.close() in JavaScript pops up a warning box. If this were not the case your request would be simple, we could just close your pop up onClick while targeting the original window by name. Since we are not so lucky, I have another idea. Instead of using a pop up window, use a DHTML pop up:


This pop up is actually on the page that generates it, so closing it and targeting the page it is on is a snap. Instead of Google, use a page of your own for its content. A link on this content page written like so:

<a href="some.htm" target="_top">Click for Some Page</a>will load in the page that launched this DHTML pop up and, since it was on that page, it will disappear at the same time.