JavaScript/jQuery: How to make sure cross-domain click tracking event succeeds before the user leaves the page?
I'm implementing click tracking from various pages in our corporate intranet in order to add some sorely needed crowd-sourced popular link features ("most popular links in your department in the last 24 hours", etc.) I'm using jQuery's .live() to bind to the mousedown event for all link elements on the page, filter the event, and then fire off a pseudo-ajax request with various data to a back-end server before returning true so that the link action fires: $("#contentarea a").live("mousedown", function(ev) { // // detect event, find closest link, process it here // $.ajax({ url: 'my-url', cache