duandu5846 2016-04-11 11:54
浏览 23
已采纳

当我退出屏幕时,我会被问到:“你要保存吗?”codeigniter

I want to do something like this: If I am viewing a record and edit it or add a new record and then exit that screen, I should be asked, “Do you want to save?”

How can I develop this thing in php? I haven't done this type of development before..

Any suggestions?

  • 写回答

4条回答 默认 最新

  • dongyan9838 2016-04-11 12:05
    关注

    use jquery onbeforeunload function it will be execute when page refresh or closing browser tab or closing browser .

     $(window).on('beforeunload', function(){
                      return 'Are you sure you want to leave?';
               });

    </div>
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(3条)

报告相同问题?