AJAX and user leaving a page

前端 未结 4 1651
心在旅途
心在旅途 2021-02-04 05:48

I\'m working on a chat and I\'m trying to figure out how I can detect that the user has left the page or not. Almost everything is being handled by the database to avoid the fro

4条回答
  •  抹茶落季
    2021-02-04 06:41

    Try to add popup (prompt("leaving so early?")) after $.post. It may work. Tho it may be bad user experience. :)

提交回复
热议问题