I\'m trying to post data when a user leaves my page. I have finally managed to find a working solution, however, it shows a confirmation dialog when the user leaves. I have
I have found a really simple trick to get this working with using
$(window).bind('onbeforeunload', function () { $.post("track.php", { async: false, refid: refid, country: country, type: type, }); });