3 ms·
I understood that much, and sure, if you try to construct browser links from scratch then their behavior won't match the behavior of real browser links. Howeve
by JoshTriplett 14y ago
I understood that much, and sure, if you try to construct browser links from scratch then their behavior won't match the behavior of real browser links. However, if you really do have an <a> tag, then you should only have the ability to override the "unmodified click case".
- skymt 14y agoI read the article as simply suggesting that developers create real, genuine <a>-tag links in their modern pushState-using web apps. Doubtful that there are enough people specifically overriding middle-clicking on links to warrant a blog post. For example (and not to call anyone out), there's this demo (warning: will fill your history): http://bodytag.org/rollstate/ http://bodytag.org/rollstate/ Looking at its source, it uses real <a> tags for its pushState() links, but with href="#". If you click on "contact", then middle-click "about", a new tab will open to "/rollstate/contact" (which 404s, another pushState() no-no).
- pbiggar 14y agoActually, there are. If you override the click handler on a link, you'll override the Cmd-click handler as a side-effect. My site does this (by accident), and I eventually had to ask StackOverflow to find that Sammy.JS (my client-side router) was doing it.
- damncabbage 14y agoAlso, Quora does it. (It's infuriating when I try to middle-click a run of interesting-looking questions and it "steals" the clicks.)
- adavies42 14y agoi assume this is much like the js-driven crap that's been around for over a decade now where the mouseover text looks real but the actual href is "javascript:void(0)" or something?