homepage Welcome to WebmasterWorld Guest from 54.227.12.219
register, free tools, login, search, subscribe, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor 2014
Home / Forums Index / Code, Content, and Presentation / HTML
Forum Library, Charter, Moderators: incrediBILL

HTML Forum

    
Target=“ blank” vs window.open
Rain_Lover




msg:4683944
 5:06 pm on Jun 30, 2014 (gmt 0)

I'm working on an application where users enter some input and they shouldn't leave the page when clicking on share links, e.g. a Facebook share link:

<a href="https://www.facebook.com/sharer.php?u=http%3A%2F%2Fwww.example.com%2F">Share on Facebook</a>

I know it's very common to use popup windows for such links. But does it have any advantage over a simple
target="_blank" attribute? How do you compare the two methods and which is the right practice in such cases?

 

matrix_jan




msg:4683978
 8:05 pm on Jun 30, 2014 (gmt 0)

target="_blank" is a HTML attribute. When JavaScript is turned off it will still work.

Speaking of which. Can someone add Target=“ _blank” to in-post links at WW. Sometimes I click and then close it. And realize I just closed the thread tab. Plus, it's good user experience to have it opened in parallel to see what's the thread is about.

lucy24




msg:4683980
 8:11 pm on Jun 30, 2014 (gmt 0)

Popups are for content that is intended to be viewed temporarily and then closed, like an image close-up or a Terms and Conditions window. "target='_blank'" links are for free-standing independent links in situations where the user isn't planning to-- or the designer doesn't expect them to-- leave the original page. Think about which type of interaction your users should have with the linked page.

But before you do that, make sure that one or the other is really necessary and appropriate. Some sites-- naming no names-- wildly overuse "target='blank'", to the point of applying it routinely to their own internal links so you end up with half a dozen separate windows or tabs all from a single activity. Users do not like this. Or, at least, this user doesn't.

Edit because I overlapped:
Forums are actually a good example of appropriate "target='_blank'". I think some standard Forums packages apply it by default to external links: sure I want to look at the page, but that doesn't mean I want to leave the forum entirely.

HTML doesn't distinguish between "new window" and "new tab". It depends on how chummy your users are with their browser's prefs.

penders




msg:4684154
 4:06 pm on Jul 1, 2014 (gmt 0)

Can someone add Target=“ _blank” to in-post links at WW


Middle Click? (or SHIFT + Middle Click?) What's the shortcut on Mac?

The
target attribute requires a transitional DOCTYPE in HTML 4, but OK in HTML 5.
matrix_jan




msg:4684187
 5:34 pm on Jul 1, 2014 (gmt 0)

Ctrl+Click works for Chrome. But when the post goes like "look at the graph, during the months of...", one assumes that the link will open in a new tab to have it checked out while reading the post.

In some cases opening in a new tab is not a good idea, but this is not it. For example: "our website has moved click here".

Imagine you're at a meeting, and a colleague is presenting something with visual aid. And you either have to look at the aid or listen to the person. OR, you have to do some extra button-pushing to have them both. Why not have bot by default? Links in posts in WW are nothing but visual aid. People are here to discuss, not to be referred somewhere else.

lucy24




msg:4684212
 7:23 pm on Jul 1, 2014 (gmt 0)

What's the shortcut on Mac?

Depends on the browser, and also on the mouse if you've got a configurable one. In fact I'm constantly coming to grief on this one, because other-click* in different browsers gives "new tab" and "new window" as the first two options-- but not in the same order.


* Canonically "right-click" but I mouse left-handed so I've reversed it.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / HTML
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved