有时在页面关闭或刷新时,需要作一些提示信息,用以下方法可以实现:
window.onbeforeunload=function(){ return '确定离开当前页面吗?'; };
博客园 © 2004-2025 浙公网安备 33010602011771号 浙ICP备2021040463号-3