window.opener.location.href doesn't work in frame

Discussion in 'ASP .Net' started by Leon, Jun 24, 2003.

  1. Leon

    Leon Guest

    From parent windows, I have created a popup windows that comprises two
    frames.
    When I have clicked a link button in one of the frames, I would like
    to redirect the parent windows to somewhere.
    So I did
    ------------------------------------------------------------------
    <a href='#' onclick='window.opener.location.href
    =""http://www.google.com"";'>Click here</a>
    ------------------------------------------------------------------

    but it didn't work.
    Without frame, it works. So I presume it has something to do with
    frame.
    Could you help me?

    Thanks in advance,
    Leon, Jun 24, 2003
    #1
    1. Advertising

  2. Instead of script, just set the "target" attribute of the anchor to "_top"

    <a href="#" target="_top">

    That tells is to navigate the "top" frame.

    If the parent is NOT the top frame (multiple nested frames), then set target
    to the name of the frame that you want to navigate

    <a href="#" target="parent_frame_name">


    "Leon" <> wrote in message
    news:...
    > From parent windows, I have created a popup windows that comprises two
    > frames.
    > When I have clicked a link button in one of the frames, I would like
    > to redirect the parent windows to somewhere.
    > So I did
    > ------------------------------------------------------------------
    > <a href='#' onclick='window.opener.location.href
    > =""http://www.google.com"";'>Click here</a>
    > ------------------------------------------------------------------
    >
    > but it didn't work.
    > Without frame, it works. So I presume it has something to do with
    > frame.
    > Could you help me?
    >
    > Thanks in advance,
    Boban Dragojlovic, Jun 24, 2003
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Marcello

    window.open location.href frame

    Marcello, Nov 12, 2003, in forum: Javascript
    Replies:
    4
    Views:
    244
    Marcello Console
    Nov 20, 2003
  2. saiho.yuen
    Replies:
    3
    Views:
    394
    kaeli
    Sep 14, 2004
  3. alison
    Replies:
    3
    Views:
    398
    Thomas 'PointedEars' Lahn
    Nov 23, 2005
  4. Giakko
    Replies:
    9
    Views:
    355
    Randy Webb
    Apr 14, 2006
  5. window.opener, form.opener?

    , Jul 14, 2006, in forum: Javascript
    Replies:
    5
    Views:
    268
Loading...

Share This Page