Javascript - Confirmation when leaving page

前端 未结 2 485
我寻月下人不归
我寻月下人不归 2021-01-14 17:15

I\'m trying to implement a basic popup window that asks the user if they really want to leave a page, similar to what would happen on this site if I tried to close the windo

2条回答
  •  离开以前
    2021-01-14 18:13

    window .unload function will help us to execute some javascript while closing the browser or redirecting to any other page. resources: http://api.jquery.com/unload/

提交回复
热议问题