页面关闭之前向后端发送请求

刚开始使用xhr,发现无法发送请求,然后找到了一个api

Navigator.sendBeacon()

 

详见:https://developer.mozilla.org/zh-CN/docs/Web/API/Navigator/sendBeacon

posted @ 2021-08-18 14:32  fengwenqi  阅读(67)  评论(0编辑  收藏  举报