“Are you sure you want to leave this page?” functions for cancel and OK

前端 未结 3 1144
伪装坚强ぢ
伪装坚强ぢ 2021-01-16 23:50

i\'m trying to do something similar to some websites where you leave and it\'ll display a popup saying \"Are you sure you want to leave this page\" and with two options sayi

3条回答
  •  南笙
    南笙 (楼主)
    2021-01-17 00:38

    To pop a message when the user is leaving the page to confirm leaving, you just do:

    
    

    To call a function:

    
    

提交回复
热议问题