3 ms·
> The alternative is to hijack the click event, wait for say 100ms, and then load the new page via JavaScript, but that also break the open in a new tab functio
by wldlyinaccurate 13y ago
> The alternative is to hijack the click event, wait for say 100ms, and then load the new page via JavaScript, but that also break the open in a new tab functionality.
How does it break the open in new tab functionality? You can detect if the user was Cmd/Ctrl-clicking, or using the middle mouse button. I've done this on many sites and it works fine.
- philipwalton 13y agoThat's a good point. I suppose I could try to detect if the click was accompanied by a CTRL/CMD keypress and open in a new tab accordingly. Still, the 100ms delay isn't ideal, and the open in a new tab paradigm greatly simplifies things.
- andybak 13y agoYour analytics aren't as important as my user experience. :)
- philipwalton 13y agoPerhaps if you were my customer, but you're just consuming the free content I've spent a good deal of time putting together :)
- a_m0d 13y agoThat doesn't include the possibility that the user right-clicks and selects "Open Link in New Tab"