有时候在编辑页面用户做修改后,可能会有刷新、关闭等误操作造成当前页面信息的丢失,何不先提醒一下用户呢?实例代码如下:

 

window.onbeforeunload = function(event){
            event = event || window.event;
            event.returnValue = ' ';
    }

相关文章: