【发布时间】:2012-12-31 14:43:14
【问题描述】:
window.onbeforeunload = function() {
if (document.getElementById("parentpan").style.display == "block") {
return "You are logged out.";
Logout();
}
};
我想在return语句之后调用logout()函数,可以吗?
【问题讨论】:
-
为什么需要按这个顺序排列?
-
技术上在注销某人之前返回
"you are logged out."是在撒谎:) -
您正在返回“您已注销。”给有确定/取消提示的用户? onbeforeunload 不像
window.confirm()
标签: javascript jquery html dom-events