更新时间:2023-08-24 19:34:52
看看JavaScripts onbeforeunload函数。
在这篇文章中可以找到一个很好的解释返回基础知识 - OnBeforeUnload事件 [ ^ ]
示例用法:
Have a look at JavaScripts onbeforeunload function.
A good explanation can be found in this article Back to Basics – OnBeforeUnload Event[^]
Example usage:
window.onbeforeunload = function(e) {
return 'Are you sure you want to leave page';
};
...希望它有所帮助。
... hope it helps.