target=”_blank” vs. target=”_new”
The target attribute of a link forces the browser to open the destination page in a new browser window. Using _blank as a target value will spawn a new window every time while using _new will only spawn one new window and every link clicked with a target value of _new will replace the page loaded in the previously spawned window. Try it out for yourself:
Links with target=”_blank”
Links with target=”_new”
target=”_new” is not a standard target value. You could use any term you like and any link that has the same target value will open in a previously spawned window. See the target=”booger” example below.
Links with target=”booger”
How can I force a link to open in a new tab instead of a new window?
There is currently no way to force a window to open in a new tab for browsers with this feature. This functionality can only be set in the preferences of the browser (see other resources section below).
What if I want the new window to display at a certain size?
The only way to do this is by using JavaScript. I recommend the method outlined at Quirksmode.org.
Other Rescources
- http://reference.sitepoint.com/html/a/target – Sitepoint reference for the target attribute.
- http://support.mozilla.com/en-US/kb/Options+window+-+Tabs+panel – How to configure Firefox to open new windows in new tabs.
- http://www.tech-recipes.com/rx/1164/internet-explorer-7-open-new-windows-in-tabs-in-ie7/ – How to configure IE7 to open new windows in new tabs instead.
Of course all of this is moot since opening pages in new windows is a usability annoyance.
[…] Here’s an awesome explanation: Using _blank as a target value will spawn a new window every time while using _new will only spawn one new window and every link clicked with a target value of _new will replace the page loaded in the previously spawned window. Try it out for yourself: […]
_new can be confusing to the user. If windows are deleted after use, then it is not confusing.
_blank can create a lot of opened windows. Closing the windows after use is the solution. But if windows are closed after use, then _new works just as nicely.
On balance, I prefer to launch new windows with _new.
It doesn’t matter which one you use when you’re talking about opening one window. But things can get confusing if you need to open multiple windows on a page since browsers treat “_new” as a window name.
[…] Codes – http://en.wikipedia.org/wiki/ISO_639 Link Targets – _blank vs. _new – https://blog.v3.russellheimlich.com/target_blank-vs-target_new/ Image Formats – http://www.webopedia.com/DidYo.....if_png.asp Image Long […]
[…] Codes – http://en.wikipedia.org/wiki/ISO_639 Link Targets – _blank vs. _new – https://blog.v3.russellheimlich.com/target_blank-vs-target_new/ Image Formats – http://www.webopedia.com/DidYo.....if_png.asp Image Long […]
Thanks for the explanation of the difference! I’ve been using “new” because I just assumed that meant “open a new window.” I had no idea what blank meant. So based on my understanding now, if we want to link to a few sites in a row (for people to read) it may be better to go with blank, whereas if it’s just one link we should go with new?
Yup, you should use target=”_blank”, the underscore is important.
Thank you.
Very useful.
UPDATE
Whatever substitute name is used for _new, providing that name is used consistently, that window will be repeatedly reused.
However, if we use target=”_one” and later target=”_two” separate, reusable, windows will be open for both.
Paul.
“target=â€_new†is not a standard target value. You could use any term you like and any link that has the same target value will open in a previously spawned window.”
See the target=â€booger†example above.
[…] para cima↑ target=â€_blank†vs. target=â€_newâ€(em […]
Thanks – great resource