Reputation: 81
In my code, after click on a link I'm open a pdf file in new tab, But after second click if that file is already open then instead of open in new tab I want to redirect to open tab of that file.
My code:
<span style="margin-left:10%;"><a href="image/Eng_Pamphlet.pdf" target="_blank">Broucher</a></span>'
As shown in above tab I'm set the target attribute "_blank", So it opens the link always in new tab. But I want after first time it redirect to first open tab only.
Upvotes: 8
Views: 3972
Reputation: 7374
Use target="_new"
instead. This will open the link in the same tab
Edit:
_new
is not really the best way to do this, as noted in the comment below by Chankey. You can just create a 'custom' value for the target
attribute that will allow the link to only open in a specific tab.
http://jsfiddle.net/GTr7L/ -> example
Upvotes: 6
Reputation: 2930
just assign a custom name to your target tab, so all the links will be redirected to your custom tab
<span style="margin-left:10%;"><a href="image/Eng_Pamphlet.pdf" target="myPDFTabAndEveryTimeThisOne">Broucher</a></span>'
(if you use "_new" another standard "_new" link will overwrite your pdf tab).
Upvotes: 5