How do I open new links outside of an iframe?
Is there any w开发者_JAVA百科ay to make an iframe act as if it were part of the page. Such as when I click a link, it either will open the links in a new tab/window by default, or have it so that when a link is clicked, it will open in the same window, but not just the iframe?
You can just set the target
attribute. To open in the current top window (top frame):
<a href="http://example.com" target="_top">Link Text</a>
Or to open in a new window:
<a href="http://example.com" target="_blank">Link Text</a>
There's also _parent
for the parent window (not necessarily the top) and _self
for the current window (the default).
Do you have control of the content that is in the iframe
?
You could use target=_top
for the links.
精彩评论