Closed cagataycali closed 3 years ago
https://developer.mozilla.org/en-US/docs/Web/API/Navigator/sendBeacon
window.onsubmit = function send_analytics() { var data = JSON.stringify({ location: location.href, time: Date() }); navigator.sendBeacon('/analytics', data); };
https://developer.mozilla.org/en-US/docs/Web/API/Navigator/sendBeacon