SitePoint Sponsor

User Tag List

Results 1 to 2 of 2

Hybrid View

  1. #1
    SitePoint Member
    Join Date
    Oct 2003
    Location
    NH
    Posts
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    javascript window close

    hello,
    I do: windowA = window.open(.....)
    From Window A, do open another window call B with
    I do: windowB = window.open(.....)
    So I have 2 windows open.
    I CAN edit the Page in window A, and put code in it.
    However, the Page in window B can not be edited.

    My Question. When someone closed window B, I want window A to close.
    Remember, the code to to this MUST be in the page in Window A.
    I need something From window a...
    ... a timer loop, testing to see if Window B is still open?

    Any ideas?? Thanks
    Larry

  2. #2
    I'll take mine raw silver trophy MikeFoster's Avatar
    Join Date
    Dec 2002
    Location
    Alabama, USA
    Posts
    2,560
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi singled,

    Code:
    var winB;
    window.onload = function()
    {
      winB = window.open(...);
      winMonitor();
    }
    function winMonitor()
    {
      if (winB.closed) {
        window.close();
      }
      else {
        setTimeout('winMonitor()', 500);
      }
    }


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
  •