Two Windows

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

    Two Windows

    Hi, I have two different windows: 1) Main page, 2) login box.

    The login.html (in 2nd window) calls login.php, it verifies if the user/pass
    info is correct, if everything is right I want that window self-close (no
    problem with window.close method) but I need also to reload main page... how
    can I do in JavaScript this? must I give a name to main window?

    It would be better if you had an example, thanks

    Jomer
    jomer@jomer.org


  • Mick White

    #2
    Re: Two Windows

    adry wrote:
    [color=blue]
    > Hi, I have two different windows: 1) Main page, 2) login box.
    >
    > The login.html (in 2nd window) calls login.php, it verifies if the user/pass
    > info is correct, if everything is right I want that window self-close (no
    > problem with window.close method) but I need also to reload main page... how
    > can I do in JavaScript this? must I give a name to main window?
    >
    > It would be better if you had an example, thanks
    >
    > Jomer
    > jomer@jomer.org
    >
    >[/color]
    From the pop-up's point of view, the main page is "opener"

    opener.history. go(0);self.clos e();

    Mick

    Comment

    • RobB

      #3
      Re: Two Windows

      "adry" <jomer@jomer.or g> wrote in message news:<41ad172e$ 1_1@filemon1.is p.telecable.es> ...[color=blue]
      > Hi, I have two different windows: 1) Main page, 2) login box.
      >
      > The login.html (in 2nd window) calls login.php, it verifies if the user/pass
      > info is correct, if everything is right I want that window self-close (no
      > problem with window.close method) but I need also to reload main page... how
      > can I do in JavaScript this? must I give a name to main window?
      >
      > It would be better if you had an example, thanks
      >
      > Jomer
      > jomer@jomer.org[/color]

      If you don't want a new history entry for that reload...

      if (opener && !opener.closed)
      {
      opener.location .replace(opener .location.href) ;
      self.close();
      }

      Comment

      Working...