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

  • Thread starter Thread starter Leon
  • Start date Start date
L

Leon

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,
 
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">
 
Back
Top