How can we do JavaScript object detection for pageShow and pageHide handlers?
if( /* pagehide is supported */ ){
window.addEventListener('pagehide', exitFunction, false);
}
else{
window.addEventListener('unload', exitFunction, false);
}
if ('onpagehide' in window) {
window.addEventListener('pagehide', exitFunction, false);
} else {
window.addEventListener('unload', exitFunction, false);
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With