HTML - How do I make a link in an iframed page overtake the current window?

At the moment I have links on our intranet do one of two things when clicked.

Open in the same iframe.

Open in a new window.
But I think the ideal would be to open in the current window but not the current iframe. In other words take over the current window.

How do I do that?

It’s been awhile, but I think it works the same as regular frames. Try: < a href=“your URL” target="_top" >.

Had enough time to edit!

I’m not sure about the parent thing, but I believe setting the target to “_top” also works:

<a href=“http://straightdope.com” target=“_top”>Clicky clicky!</a>

EDIT: Hmm, maybe not so much. It’s been a long, long time since I’ve done anything with frames. :stuck_out_tongue:

EDIT2: Woops, my mistake. It does work. :smiley:

Delete repeat. I had just enough time to edit the old post

It works when I add a _ to the beginning of parent…
< a href=“your URL” target="_parent" >.

Thanks for the help. Pretty much answered straight away. GQ doesn’t disappoint. (Nor does Swallowed My Cellphone :slight_smile: )

target=_parent seems to work also :slight_smile: (see my last reply)

This is going to make life easier, less ending up with several windows open to get to the right page(s)

Lobsang, there is a slight difference between “_top” and “_parent”.

If you want your link to be the main page, make sure it’s “_top”.

For example, I used to work on a page that had three framesets: header, middle, and footer (vertically arrranged). If the “middle” frame had an iFrame and I used “_parent” as the target of my link, then thew new link would be in the space of the “middle” frame (like a child taking the place of its parent frame). The other two frames, “header” and “footer” would still be there.

If I used “_top” the frames would go away because the linked URL would be the whole kit and kebootle. Sorry about that. As I said, it’s been awhile. When I checked an old example of work I did awhile ago, it jogged my memory. That why I tried to rush and correct myself. If you don’t have any other framesets, it won’t really matter.

That makes sense. I’ll use _top instead.

Currently the page in question only has two ‘children’ (two iframes) so it’s not an issue. But to be correct (as I like to be) I’ll use _top instead.

Thanks again.

Awesome, glad I didn’t lead you astray and Potato had my back.

Oh, I didn’t see Potato’s replies. Thanks also to Stealth Potato