How can I stop this event from occurring on browser refresh? Here is the code:
if ($("body").attr('onbeforeunload') == null) {
if (window.event) {
// IE and Chrome use this
$("body").attr('onbeforeunload', 'CatchLeavePage(event)');
<?php
// Log out when browser is closed
echo " location.href=\"/logout.php\"";
?>
}
How can I stop this event from occurring on browser refresh?