my ajax query doesn't work time to time!!!
Hello everyone ;
I'm writing an application with PHP that let me have statitics about visited pages for my web site. to save informations needed i use an ajax query with the unload event. The problem that i have is titme to time the script uses with that ajax query doesn't work especially when i stay long time in a page.
this is my code?
<script type="text/javascript">
function closeIt() {
$.ajax({
async: "false",
url : "out.php",
success : function(data) {
}
});
}
$(function(){
$(window).bind('beforeunload ',function(){
//$.post( "out.php");
closeIt();
});
})
</script>
why it works most of time but sometime doesn t work???
is there any specifications to take for the unload event ??
Thanks for your help.