window.onbeforeunload = function(){ return "该页面无法保存当前状态,是否确认退出?";}; 转载于:https://www.cnblogs.com/ForFreeDom/archive/2009/12/24/1631398.html