如何阻止此事件在浏览器刷新时发生?这是代码:
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\"";
?>
}
如何阻止此事件在浏览器刷新时发生?