关闭窗口前弹出对话框 $(function(){ window.onbeforeunload = function(){ event.returnValue = "您正在编辑的信息尚未提交,离开本页面后信息将丢失!"; };}