Hacker News new | ask | show | jobs
by walesmd 6611 days ago
Never open a new window automatically - let the user middle-click.
2 comments

Several exceptions to this.

For example, links received in email, if you view the email via a webmail client gmail for instance, and click on the link, it will open in a new window.

I think it depends on the % of users that will want to go back to your app after looking at the link. And with ajax type apps, the back button just doesn't cut it.

I don't know about "never." I spend a lot of money getting users to my site (I'm not web 2.0, but rather a downloadable software product). I'm not eager to send them elsewhere. That's one of my gripes about xhtml 1.0 strict: target="_blank" doesn't validate. So, my site is all strict except the links page, which has to be transitional to validate.
It doesn't validate because breaking my preferences and opening a new window which I didn't ask for is (apart from being an obnoxious thing to do) a 'behaviour'.

The "Strict" standard, rightly, enforces a division between content (XHTML), design (CSS) and behaviour ({Java|ECMA}script).

If you want links to open in external windows, attach a behaviour to the link class with JS. Just make sure that behaviour is off by default, though, because otherwise people like me who know what we're doing won't use your site.

I don't use JS on my site, because others won't use the site with JS. The link page is the only page on the site that does this, so I'm going to go with it.

It's not obnoxious if you consider that some people really don't understand how the web works or what the difference is between sites. In that case it's a convenience.

This is an idea which should be left as a "best practice," but allow for reasonable differences.