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-method. But unfortunately not every click is logged, if the user uses firefox (everything looks ok in IE).
I've tried many things but have no solution to this problem, have anybody a glue?
HTML-Code:
<a href="http://google.com" onclick="return loggClick();">Click</a>
JS-jQuery-Skript:
function loggClick(){
$.ajax({
type: "POST",
url: "Logger.ff", //dynamic url to logging action
data: {
sid: 'abc123' //random data
},
contentType: "application/x-www-form-urlencoded; charset=UTF-8",
cache: false
});
return true;
}
EDIT: I've missed in the example that i have to pass dynamic parameters in the js-call, so it's "not possible" to remove the onclick-event :(