Seeking a solution similar to this question: Reliably complete Ajax request on page unload
I am in need of triggering a network request before the page closes without requiring the response value. However, simply placing it within my beforeunload handler does not achieve the desired outcome:
window.addEventListener('beforeunload', () => {
// send ajax
}
While it works effectively with sendBeacon, I am looking for a cross-browser compatible solution as sendBeacon may not be supported in all browsers.