beforeunload
var isOnIOS = navigator.userAgent.match(/iPad/i)|| navigator.userAgent.match(/iPhone/i); var eventName = isOnIOS ? "pagehide" : "beforeunload"; window.addEventListener(eventName, function (event) { ... } );
navigator.platform === 'iPad'
navigator.platform === 'iPhone'
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)