eare (20)
Badeni
Biografie
Servicii
- Alte servicii interactive
Servicii extra
Despre mine( Feminin )
Avoid unload and beforeunload
In the past, many websites have used the unload or beforeunload events to send analytics at the end of a session. However, this is extremely unreliable. In many situations, especially on mobile, the browser will not fire the unload, beforeunload, or pagehide events. For example, these events will not fire in the following situation:
The user loads the page and interacts with it.
When they are finished, they switch to a different app, instead of closing the tab.
Later, they close the browser app using the phone's app manager.
Additionally, the unload event is incompatible with the back/forward cache (bfcache) implemented in modern browsers. Some browsers, such as Firefox, handle this incompatibility by excluding pages from the bfcache if they contain unload handlers, thus hurting performance. Others, such as Safari and Chrome on Android, handle it by not firing the unload event when the user navigates to another page in the same tab.
Firefox will also exclude pages from the bfcache if they contain beforeunload handlers.
Use pagehide as a fallback
To support browsers which don't implement visibilitychange, use the pagehide event. Like beforeunload and unload, this event is not reliably fired, especially on mobile. However, it is compatible with the bfcache.
Cadoul meu
- 30 minute / 123 Pupici
Limbi vorbite
- Engleza [ Conversational ]