Opening link in parent window

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

    #1

    Opening link in parent window

    Greetings;

    I am unable to solve this problem; I hope someone will come up to show
    his brilliance.


    From my web page I open another link in another browser window. That
    new window is composed of two frames. I have a <a
    href="....."> link on the second frame of that window. What I want is
    that when user clicks on the link in the new window's second frame,
    the response should open in the original browser window that opened
    this secondary window(which is made of two frames). How can I do it?I
    hope i have explained my problem.

    I tried to used window.opened.l ocation.href but it didnt work because
    I have frames in my secondary window...

    Thanks
  • Dave Anderson

    #2
    Re: Opening link in parent window

    "Farooq Karim" wrote:[color=blue]
    >
    > From my web page I open another link in another browser window. That
    > new window is composed of two frames. I have a <a
    > href="....."> link on the second frame of that window. What I want is
    > that when user clicks on the link in the new window's second frame,
    > the response should open in the original browser window that opened
    > this secondary window(which is made of two frames). How can I do it?[/color]

    You can do it a couple of ways. As Martin suggested, you can use named
    windows. That is probably the preferred method.

    If you opened the second window with window.open(), you can use [top.opener]
    as a reference to the original window. In this case, [top] refers to the
    window that contains the frameset, and that window has an [opener] property
    containing a reference to the original:

    top.opener.loca tion.replace("m yNewURL.asp")


    --
    Dave Anderson

    Unsolicited commercial email will be read at a cost of $500 per message. Use
    of this email address implies consent to these terms. Please do not contact
    me directly or ask me to contact you directly for assistance. If your
    question is worth asking, it's worth posting.


    Comment

    • @SM

      #3
      Re: Opening link in parent window

      Farooq Karim a ecrit :[color=blue]
      >
      > Greetings;
      >
      > I am unable to solve this problem; I hope someone will come up to show
      > his brilliance.
      >
      > From my web page I open another link in another browser window. That
      > new window is composed of two frames. I have a <a
      > href="....."> link on the second frame of that window. What I want is
      > that when user clicks on the link in the new window's second frame,
      > the response should open in the original browser window that opened
      > this secondary window(which is made of two frames). How can I do it?I
      > hope i have explained my problem.[/color]

      Glou glou glou ...
      Glup glup glup ...

      - 1st window : frame11 - frame12 - frame13
      - 2nd window : frame21 - frame22

      - window2-frame22 : link to window1-frame13

      <a href="page007.h tm" target="_blank"
      onclick="opener .frame13.locati on=this.href;
      return false;
      ">Page 007</a>
      [color=blue]
      > I tried to used window.opened.l ocation.href[/color]

      * window.opener.M yFrame.location .href *
      ^^^^^^ ^^^^^^^
      [color=blue]
      > but it didnt work because
      > I have frames in my secondary window...[/color]

      Not only ... *opened* is not correct

      *opener* works only if it refers to a window in which
      a page have a the JS *window.open()* that opened the
      new window that use this *opener*

      glup glup glup ... :-)

      -- ----
      @SM
      move away *OTEZ-MOI* from my reply url

      Comment

      • Farooq Karim

        #4
        Re: Opening link in parent window

        Thanks Dave!

        I just used

        top.opener.loca tion.href = link

        it worked perfectly.

        "Dave Anderson" <GTSPXOESSGOQ@s pammotel.com> wrote in message news:<ej16nZ#wD HA.1744@TK2MSFT NGP12.phx.gbl>. ..[color=blue]
        > "Farooq Karim" wrote:[color=green]
        > >
        > > From my web page I open another link in another browser window. That
        > > new window is composed of two frames. I have a <a
        > > href="....."> link on the second frame of that window. What I want is
        > > that when user clicks on the link in the new window's second frame,
        > > the response should open in the original browser window that opened
        > > this secondary window(which is made of two frames). How can I do it?[/color]
        >
        > You can do it a couple of ways. As Martin suggested, you can use named
        > windows. That is probably the preferred method.
        >
        > If you opened the second window with window.open(), you can use [top.opener]
        > as a reference to the original window. In this case, [top] refers to the
        > window that contains the frameset, and that window has an [opener] property
        > containing a reference to the original:
        >
        > top.opener.loca tion.replace("m yNewURL.asp")[/color]

        Comment

        Working...