I want to log all clicks on a link.
I\'ve written a little logger, which can be called by an url (returns an empty page). This url is called with a jquery-ajax-metho
The above poster is correct, it is unreliable because you are leaving the page before it has a chance to log it.
You could do this:
1) return false, so the href isn't active. 2) log the click 3) use location.href to redirect to the url it would have been redirected to
you might see a slight delay if it takes long time for your onclick handler to execute.