Results 1 to 2 of 2

Thread: Need Break Out of Pop-Up Script

  1. #1
    Join Date
    Apr 2005
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Need Break Out of Pop-Up Script

    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.

    Thanks

    Doug C.

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    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:

    http://dynamicdrive.com/dynamicindex8/dhtmlwindow.htm

    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:

    HTML Code:
    <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.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •