I have a site where I have a lot of outgoing links and I would like to count the clicks to those outgoing links.
I need to keep the links need to be visible. (as in, no Digg like links or redirects).
So I was thinking of hooking some jQuery function to all outgoing links. This function then calls a PHP script via AJAX that updates the counter.
I have done similar things with form submitting. Where the form's onsubmit does a return of a JavaScript function. But does it work with onclick and links? Wondering about scenarios like when a person middle clicks in Firefox to get a new tab.
BTW I do not care about people with JavaScript off. They will just go to the link and not be counted, it's fine.