opening browser...

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

    opening browser...

    My main window pops a "remove control" window from which user clicks
    on links that are displayed in parent window.

    users however have a tendency of closing the parent window. How can i
    check the existance of the parent window and if it does not exist open
    a new one ?

    thanks to all

  • scripts.contact@gmail.com

    #2
    Re: opening browser...

    On Mar 5, 2:43 pm, "Mel" <MelHer...@gmai l.comwrote:
    My main window pops a "remove control" window from which user clicks
    on links that are displayed in parent window.
    >
    users however have a tendency of closing the parent window. How can i
    check the existance of the parent window and if it does not exist open
    a new one ?
    >
    thanks to all
    window.opener returns the window that opened the current window so
    check if window.opener is null or not.

    Example :
    if(!window.open er){ //-WINDOW CLOSED, Open NEW// }

    But i tested this in IE and window.opener returns the window object
    even when the parent window is closed (someone correct me if this is
    wrong) so check for window.opener then check for
    window.opener.c losed :

    if(opener && opener.closed){
    // -WINDOW CLOSED,OPEN NEW- //
    }else if(!opener){
    //-WINDOW CLOSED...
    }

    Comment

    • scripts.contact@gmail.com

      #3
      Re: opening browser...

      On Mar 5, 2:43 pm, "Mel" <MelHer...@gmai l.comwrote:
      if(opener && opener.closed){
      // -WINDOW CLOSED,OPEN NEW- //
      }else if(!opener){
      //-WINDOW CLOSED...
      }

      -OR-

      if(!opener || opener.closed){
      //-WINDOW CLOSED-//
      }

      Comment

      Working...