Back in the day, I could make a link with a target like this:
<a href="https://example.com/something" target="frameName" />
If a frame named frameName didn't exist on the page, the link would open in a new window/tab. That still works today. Now, add a second link:
<a href="https://example.com/somethingElse" target="frameName" />
If I click the first link, it opens in a new tab/window. If I then click the second link, I would expect it to open in that same tab/window that was opened for the first link. However, this isn't happening. Instead, the second link opens up in its own new tab/window.
Has this behavior changed? How can I get the old behavior back?
Related
Is it possible to make a button, that when clicked, opens a new tab. Not any link, just a new tab. so far I have <button target="_blank" onclick="location.href = ''">New Tab</button>
Simply link to about:blank with the target _blank
<a target="_target" href="about:blank"><button>New Tab</button></a>
The answer is, its impossible. You can't navigate to the users default home page, as stated by Gradyn Wursten. Though you can navigate to a blank white page, using about:blank
So I already know how to open a link into a new tab by using the target=_blank.
My question is how do you open a second link onto that same tab instead of opening another new tab making three instead of two tabs?
Example:
<a href="allProducts.html" target=_blank>Products</a>
When clicked, should open a new tab.
<a href="allArtists.html" target=_blank>Artists</a>
When this is clicked, should open onto the previous new tab and not open another new tab.
So you should have the initial page, then click on allProducts to get that page on a new tab, and then click allArtists to open onto the allProducts tab to replace it instead of opening a third tab.
You can give the <a>s a common target attribute, one other than _blank, for example:
Products
Artists
Cannot embed due to stack snippet sandboxing, but you can see it in action here:
https://jsfiddle.net/kbqp6dwa/
You'd think I'd be able to work this out from Google, but I've had no luck.
I'm building a content aggregator, imagine a list of links to external sites. Every time I click a link I would like to open a new tab.
At the moment I have target="blank" but what happens is the first link opens a new tab, and all of the subsequent clicks just overwrite the newly opened tab - opening a grand total of 1 new tabs.
As opposed to what I want which is if I click 5 external links, it opens 5 new tabs.
Other aggregators like Digg.com and Delicious somehow manage it, but their a tags's are no different to mine.
Thanks folks
Edit:
Here's how the links are at the moment:
<a class="header" href="/links/56bae5109e1b937548000307/go" rel="nofollow" target="blank">Finding Dory: new posters land</a>
You were close, just make sure there is an underscore _ in front of blank as the value:
<a class="header" href="/links/56bae5109e1b937548000307/go" rel="nofollow" target="_blank">Finding Dory: new posters land</a>
This is because _blank is an actual special word that instructs the browser to open new tab or window. W3Schools:
_blank Opens the linked document in a new window or tab
whereas you had just blank which will be interpreted as a specific window target name, thus all links kept opening to that target.
You should try,
<a class="header" rel="nofollow" target="_blank" href="http://your_url_here.html">Finding Dory: new posters land</a>
If you set the target attribute to "_blank", the link will open in
a new browser window or a new tab.
"blank" causes the result what are you experiencing now,
I have target="blank" but what happens is the first link opens a new
tab, and all of the subsequent clicks just overwrite the newly opened
tab - opening a grand total of 1 new tabs.
like what you said before.
I have the following link on my page. The link points to an internal address.
Add XYZ and do ABC
When I click on the link, nothing happens. The browser shows a loading icon, but stays on the current page. If I right click on the link and say open in new tab, the link open perfectly in the new tab. What is the reason for this? How do I go about debugging this?
You need to set the target of the hyperlink element
Add XYZ and do ABC
Another example (which if copied directly into a HTML file will work)
Goto Google
I have a page with a ton of links (foo). If a user opens a link they get a new window (bar) via target="_BLANK" in the link. But if they go back to foo and click on another link instead of another new window (bar2), bar navigates to the new link.
This is only an issue in IE Fx opens a new tab. I need IE to do the same. Or open a new window.
Thanks!
In Internet Explorer, the case of the target property matters. You should set your target to "_blank" instead of "_BLANK". If you want to try it out, go right ahead.
Name the targets _blank1, _blank2, etc.