SitePoint Sponsor

User Tag List

Results 1 to 4 of 4

Hybrid View

  1. #1
    SitePoint Enthusiast
    Join Date
    Nov 2003
    Location
    Texas
    Posts
    57
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    JavaScript: Closing window after new opened

    Hi Everyone,

    I'm trying to figure out a way to do the following:

    1) index.html comes up to select a flash or html based site.
    2) User selects one, or the other choice, and a new window is spawned with the choice of site.
    3) Now I want to close the original window, index.html.

    #3 is what I'm having problems with. I need to close that "choice menu" once they click a choice and a new window spawns.

    Would appreciate any suggestions, thanks much!

    Wade

  2. #2
    SitePoint Enthusiast kgish's Avatar
    Join Date
    Dec 2001
    Location
    Gouda, The Netherlands
    Posts
    64
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Rather than closing the parent window (index.html) why not use document.location = new_location and close the selection window?
    Kiffin
    Your average future-famous kind of guy...

  3. #3
    SitePoint Zealot tss68nl's Avatar
    Join Date
    Nov 2002
    Location
    Netherlands
    Posts
    165
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    In the just opened window, you can refer to it's parent window with window.opener . This will address the first window. So window.opener.close() should do it

  4. #4
    SitePoint Enthusiast
    Join Date
    Nov 2003
    Location
    Texas
    Posts
    57
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thank you both for your kind suggestions!


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
  •