Find any open windows from different parents

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • J.R

    Find any open windows from different parents

    I'm trying to determine if a named child window has been opened before
    opening a new one, however my challenge is that the child window may have
    been opened from a parent that no longer exists, therefore there is no
    access to the child window handle. Any ideas?

    Thanks All.


  • Grant Wagner

    #2
    Re: Find any open windows from different parents

    "J.R" wrote:
    [color=blue]
    > I'm trying to determine if a named child window has been opened before
    > opening a new one, however my challenge is that the child window may have
    > been opened from a parent that no longer exists, therefore there is no
    > access to the child window handle. Any ideas?
    >
    > Thanks All.[/color]

    Just call window.open() with the same 2nd parameter (window name) as before.
    If the window is currently open, the content will be directed to it, if it's
    not open, it will be opened and the content loaded.

    --
    | Grant Wagner <gwagner@agrico reunited.com>

    * Client-side Javascript and Netscape 4 DOM Reference available at:
    *


    * Internet Explorer DOM Reference available at:
    *
    Gain technical skills through documentation and training, earn certifications and connect with the community


    * Netscape 6/7 DOM Reference available at:
    * http://www.mozilla.org/docs/dom/domref/
    * Tips for upgrading JavaScript for Netscape 6/7 and Mozilla
    * http://www.mozilla.org/docs/web-deve...upgrade_2.html


    Comment

    • J.R

      #3
      Re: Find any open windows from different parents

      Thank you for your reply Grant.

      Yes, it does replace the named window using the method you suggested,
      however when I check my window object reference opened by the now non
      existent parent with the following code
      WinObj = window.open(
      theUrl,winName, 'scrollbars=no, resizable=no,to p=0,left=0,widt h=740,height=50 0
      ' );

      WinObj does not any longer contain the windows handle, at least not
      recognized by the new parent when I check as follows,

      if(window.WinOb j == null)

      and what I need to do is intercept this and respond to the user.

      Any thoughts?

      Thanks again, John.

      "Grant Wagner" <gwagner@agrico reunited.com> wrote in message
      news:3F32604C.E C2F720A@agricor eunited.com...[color=blue]
      > "J.R" wrote:
      >[color=green]
      > > I'm trying to determine if a named child window has been opened before
      > > opening a new one, however my challenge is that the child window may[/color][/color]
      have[color=blue][color=green]
      > > been opened from a parent that no longer exists, therefore there is no
      > > access to the child window handle. Any ideas?
      > >
      > > Thanks All.[/color]
      >
      > Just call window.open() with the same 2nd parameter (window name) as[/color]
      before.[color=blue]
      > If the window is currently open, the content will be directed to it, if[/color]
      it's[color=blue]
      > not open, it will be opened and the content loaded.
      >
      > --
      > | Grant Wagner <gwagner@agrico reunited.com>
      >
      > * Client-side Javascript and Netscape 4 DOM Reference available at:
      > *
      >[/color]
      http://devedge.netscape.com/library/...ce/frames.html[color=blue]
      >
      > * Internet Explorer DOM Reference available at:
      > *
      >[/color]
      http://msdn.microsoft.com/workshop/a...ence_entry.asp[color=blue]
      >
      > * Netscape 6/7 DOM Reference available at:
      > * http://www.mozilla.org/docs/dom/domref/
      > * Tips for upgrading JavaScript for Netscape 6/7 and Mozilla
      > * http://www.mozilla.org/docs/web-deve...upgrade_2.html
      >
      >[/color]


      Comment

      • Grant Wagner

        #4
        Re: Find any open windows from different parents

        Well, if page1.html calls WinObj = window.open(... , "TheName", ...), then the browser
        containing page1.html is closed, of course your window reference will be lost.

        So the solution is to do WinObj = window.open(... , "TheName", ...) on page2.html. You
        will now have a new reference to the same window you opened before (or if the window
        didn't exist, it will be opened and you will have a reference to that newly opened
        window).

        "J.R" wrote:
        [color=blue]
        > Thank you for your reply Grant.
        >
        > Yes, it does replace the named window using the method you suggested,
        > however when I check my window object reference opened by the now non
        > existent parent with the following code
        > WinObj = window.open(
        > theUrl,winName, 'scrollbars=no, resizable=no,to p=0,left=0,widt h=740,height=50 0
        > ' );
        >
        > WinObj does not any longer contain the windows handle, at least not
        > recognized by the new parent when I check as follows,
        >
        > if(window.WinOb j == null)
        >
        > and what I need to do is intercept this and respond to the user.
        >
        > Any thoughts?
        >
        > Thanks again, John.
        >
        > "Grant Wagner" <gwagner@agrico reunited.com> wrote in message
        > news:3F32604C.E C2F720A@agricor eunited.com...[color=green]
        > > "J.R" wrote:
        > >[color=darkred]
        > > > I'm trying to determine if a named child window has been opened before
        > > > opening a new one, however my challenge is that the child window may[/color][/color]
        > have[color=green][color=darkred]
        > > > been opened from a parent that no longer exists, therefore there is no
        > > > access to the child window handle. Any ideas?
        > > >
        > > > Thanks All.[/color]
        > >
        > > Just call window.open() with the same 2nd parameter (window name) as[/color]
        > before.[color=green]
        > > If the window is currently open, the content will be directed to it, if[/color]
        > it's[color=green]
        > > not open, it will be opened and the content loaded.[/color][/color]

        --
        | Grant Wagner <gwagner@agrico reunited.com>

        * Client-side Javascript and Netscape 4 DOM Reference available at:
        * http://devedge.netscape.com/library/...ce/frames.html
        * Internet Explorer DOM Reference available at:
        * http://msdn.microsoft.com/workshop/a...ence_entry.asp
        * Netscape 6/7 DOM Reference available at:
        * http://www.mozilla.org/docs/dom/domref/
        * Tips for upgrading JavaScript for Netscape 7 / Mozilla
        * http://www.mozilla.org/docs/web-deve...upgrade_2.html


        Comment

        Working...