I have a jquery function, it goes like that:
$(window).unload(function() {
chat.logout();
});
I want to active the other function, chat.logout(); only when the user leaves the page, or when the link target (href) is not play.php?mod=.... I don't want that the function will run on page refresh or any other case.
How can I do that?