Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
当用户按下 Alt+F4 或在基于 Gecko 的浏览器中使用 javascript window.close() 时如何检测窗口关闭事件?
window.onbeforeunload =function(){return '';}
…………
window.onunload = function(){ alert('I am getting closed !!'); };