4 ms·
I love and use this idea, but the OP missed the Shift key. At least Firefox and Chromium use Shift+click to open the link in a new window and I'm pretty sure IE
by TomasSedovic 16y ago
I love and use this idea, but the OP missed the Shift key. At least Firefox and Chromium use Shift+click to open the link in a new window and I'm pretty sure IE does that as well but I can't test that now.
This is what I use:
$('.some-snazzy-selector').click(function(ev){
if( ev.which == 2 || ev.metaKey || ev.ctrlKey || ev.shiftKey ) return true;
e.preventDefault();
/* Awesome AJAX code goes here */
});
I posted this comment on the blog, but it may reach someone else here, too.
- hdragomir 16y agoYep, thank you. Post updated.