We can use fetch() for all major browsers and for IE we can still use XHR. The problem with sendBeacon() is, it send data whenever browser thread is available to send, it may send data before unload, it may send data during the reload, it may send data after the reload as well, and that solution is not working when we want to send data synchronously before navigation or reload.

SendBeacon() can be used for log, analytics but not something that we need data before the page reloads.

--

--

Software Engineer @Zalando, Living in Germany, Tech enthusiast, Story Teller, Write about my learning and experiences in tech and in life.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Abhinav Kumar

Software Engineer @Zalando, Living in Germany, Tech enthusiast, Story Teller, Write about my learning and experiences in tech and in life.