I have this simple piece of code -
$(window).bind('beforeunload', function(){
alert("Good Bye")
});
Works great with Firefox, IE8 but not in Chrome. Is it a known problem or is there any alternative for that ?
Actually what I am trying to do is to log details whenever user tries to close the browser.
function LogTime()
{
jQuery.ajax({
type: "POST",
url: "log.php",
data: "",
cache: false,
success: function(response)
{
}
);
}
$(window).bind('beforeunload', function(){
LogTime();
});
This works well in Firefox, but not in Chrome