Ok, basicly, I made a script (that one) that makes a .post to a php file, which then insert some info into a database to track link clicks. Works fine in IE8 and Opera 10, but, doesn't work in Firefox. It simply loads the link target without inserting into the database. It only works if I add an alert() or return false; something that prevents it from going to the link clicked, which is not what i need. I've tried all kind of stuff, nothing helps. Looks like Firefox loads the other page faster than it can parse the script. Opera and IE wait, FF doesn't. Any ideas what might help?
$(document).ready(function(){
$("div.buy_block_content a,div.upper-banner a, a.lehitse-big, a.lehitse-small").click(function(){
var type = $(this).attr('id');
var klass = $(this).attr('class');
var pathname = window.location.pathname;
var linka = $(this).attr('href');
$.post("/sites/all/modules/statistics_track/track.php", { link: linka, source: pathname, type: type, klass: klass });
});
});
Edit: Worth to tell is that the tracking is done on Drupal (CMS) so any modifications in the core or passing some stuff with the link doesn't help. And the tracking is done for both internal links, and links that take you to other sites. I'm just curious, why Opera and IE eat it, and FF doesn't like it...