I have an iframe that pops up on an HTML page. In the iframe popup there is a link. When a user clicks the link I want the link to open a new tab in the main browsers and not in the iframe. I have tried adding the following
<a href="" target="_parent">Test</a>
all this does is open the page in the main browser (not in a new tab) therefore the user leaves the page.
Any help appreciated!
I have an iframe that pops up on an HTML page. In the iframe popup there is a link. When a user clicks the link I want the link to open a new tab in the main browsers and not in the iframe. I have tried adding the following
<a href="http://www.google." target="_parent">Test</a>
all this does is open the page in the main browser (not in a new tab) therefore the user leaves the page.
Any help appreciated!
Share Improve this question asked Feb 3, 2012 at 14:33 jshotzjshotz 492 silver badges9 bronze badges 1- 2 You can ask that a page be opened in a new window, but the browser user has control over whether it's a tab or a separate window. – Pointy Commented Feb 3, 2012 at 14:37
2 Answers
Reset to default 8Here are some values for the target
attribute
_blank
= Loads the page into a new browser window.
_self
= Loads the page into the current window.
_parent
= Loads the page into the parent
W3C Docs here on target attribute (right at the bottom)
Updated: as pointed out by @Eregrith in the ments below - you cannot make the link open in a new tab - that is controlled client side (in the browser settings) you can open it in a different window - using _blank
i know its too late to reply, but may be this will be helpful for someone,
if you can place an iFrame to your website and do not want to be open its link to the same frame, just follow the simple steps below...
create an empty div with position absolute with the relative to its outer div...
Overlap the link button with this div, add tag and add the same link with target blank.
<div class="your_name"> <a href="domain.">; </a> </div> <style type="text/css"> .your_name { position:absolute; top: 5px; /*adjust its top and left position as required*/ left:5px; } .your_name a { width:20px; /* add height and width as required */ height:10px; display:block; } </style>
cheers..!!!