[英]javascript onbeforeunload then onunload event
Trying to use onbeforeunload
then onunload
but the onunload
script does not seem to work. 尝试先使用
onbeforeunload
再使用onunload
但onunload
脚本似乎无法正常工作。
window.onbeforeunload = confirmExit();
window.onunload = unloading();
function unloading() {
alert("testicles");
confirm("try");
}
function confirmExit(evt) {
return 'test1';
}
It seems you missed "()" while calling unloading function. 似乎您在调用卸载功能时错过了“()”。 Try this:
尝试这个:
window.onbeforeunload = confirmExit();
window.onunload = unloading();
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.