What's the difference between <a target="_new">
and <a target="_blank">
and which should I use if I just want to open a link in a new tab/window?
相关问题
- Views base64 encoded blob in HTML with PHP
- Is there a way to play audio on a mobile browser w
- HTML form is not sending $_POST values
- implementing html5 drag and drop photos with knock
-
Why does the box-shadow property not apply to a
Also, every link clicked with a target value of _new will replace the page loaded in the previously spawned window.
You can click here When to use _blank or _new to try it out for yourself.
TL;DR
USE _blank
The target attribute specifies where to open the linked document.
SINCE "_new" is not any of these IT WILL COME UNDER "framename" so if a user re-clicks on that hyperlink it will not open a new tab instead update the existing tab. Whereas in _blank if user clicks twice then 2 new tabs open.
This may have been asked before but:
"every link that specifies target="_new" looks for and finds that window by name, and opens in it.
If you use target="_blank," a brand new window will be created each time, on top of the current window."
from here: http://thedesignspace.net/MT2archives/000316.html
Caution - remember to always include the "quotes" - at least on Chrome,
target=_blank
(no quotes) is NOT THE SAME astarget="_blank"
(with quotes).The latter opens each link in a new tab/window. The former (missing quotes) opens the first link you click in one new tab/window, then overwrites that same tab/window with each subsequent link you click (that's named also with the missing quotes).
The use of _New is useful when working on pages that are Iframed. Since target="_blank" doesn't do the trick and opens the page on the same iframe... target new is the best solution for Iframe Pages. Just my five cents.
target="_blank"
opens a new tab in most browsers.