Wow, this one has me tearing my hair out.
I'm tracking links in JQuery.
$(".hdr a[id]").mousedown(function(e){
var h = this;
var url = "/g/click/" + this.id;
$.get(url);
});
It appears that sometimes the browser beats the ajax call. The new page is loaded before the click tracker is fired. (It's not slow response time; the request doesn't even hit apache). This is intermittent and not readily reproducible, but it tends to appear after the user has been doing a lot on the site.
I used preventDefault in an earlier iteration of this, but that ends up breaking cmd-click and doesn't track right-clicks.
Is there a way to ensure this will run?
Thanks for all your help.