6 ms·
> Don’t open links in new browser tabs. Tabbed browsing is for advanced users. If you open a page in a new tab, most users will get lost. . . And many of the a
by bunderbunder 14y ago
> Don’t open links in new browser tabs. Tabbed browsing is for advanced users. If you open a page in a new tab, most users will get lost. . .
And many of the advanced ones will still get irritated. I can manage my own tabs, TYVM, and don't appreciate it when web designers presumptuously attempt to decide for me when I do and do not want a page to open in a new one.
- shawabawa3 14y agoI think he means don't make links automatically open in new tabs when you left click them, middle mouse or whatever will still open in a new tab.
- kodablah 14y agoThis is what a lot of websites seem to have a problem with. It's not that difficult to put an href in your anchor. Then in your click handler, simply check modifier keys (ctrl, alt, shift) and if none of them are pressed, return true. Otherwise, do your HTML5 history (or hashbang) URL change normally. Here's kinda how I've done it in CoffeeScript (though not sure if exactly right): linkClickHandler = (e) -> # can't have meta key if not e.originalEvent?.ctrlKey and not e.originalEvent?.altKey and not e.originalEvent?.shiftKey # defer the work so we can kill the link right away deferred = () => href = $(e.target).attr 'href' if href? #do something here like history.pushState setTimeout deferred, 0 # stop bubbling and return false e.stopPropagation() return false else return true This gives the users that want to save links and open them in other ways, but still have a good feel when left click only. Clicking on directories in Github source trees demonstrate this well.
- LogicHoleFlaw 14y agoHow does that respond to middle-mouse-clicks? I use that for open-in-new-tab functionality all the time. There's no need to chord the mouse and keyboard together for it. Right-click->context menu is the same way.
- kodablah 14y agoFrom my experience, middle mouse clicks do not trigger the handler. Here's a fiddle to test: http://jsfiddle.net/GTWfn/ http://jsfiddle.net/GTWfn/. Try middle-clicking that link vs. left clicking.
- rfurmani 14y agoVery true, this is especially a bugbear of mine when browsing on iPhone. All too often I have eight tabs open that I'm meaning to get back to. Then I click on a link (or accidentally click an ad) and my heart lurches as the link opens a new tab, so Safari very helpfully destroys my oldest tab and I lose whatever was there. I've noticed quite consistently that this behavior comes with sites that just want to keep you on there, so they open external links in a new tab, usability be damned.
- pronoiac 14y agoI hate that too, and here's a way to get that tab back: wait for the new page to load, and then the back button works, taking to back to the not-exactly-overwritten page.
- rfurmani 14y agoI think that works if you follow a link from another app, but not if it is a popup from safari? Or maybe they changed this in ios 5
- Karunamon 14y agoThis is a sad commentary on the computer literacy of the average user. Tabbing is a basic, basic concept graspable by small children. Note that I'm not at all disagreeing with the point, but.. geez. People are dumb.
- bunderbunder 14y agoIt's amazing how many things there are that small children can learn readily, where adults have a difficult time learning. Languages, musical instruments, even things as mundane as people's names. The loss of neural plasticity as we age is certainly regrettable at first glance. But it's not all downsides, and it can hardly be summarized with a flip, "People are dumb." There's evidence to suggest that it's actually an annealing process that's necessary part of staying smart and perhaps even achieving mastery of one's specialty. People who work in machine learning are all familiar with analogous concerns such as overfitting.