javascript - How to detect wake from sleep in the browser on iOS/Android? -


i want able refresh page when user returns page different tab or waking device.

i have sworn read somewhere pageshow event fired window, turns out not case.

window.onfocus seems trick, have confirmed if works reliably or if there more appropriate way this.

i'm sure event focus can here

$(window).focus(function() { //do_something 

}); or if want bind other events mousemove

$('*').bind('mousemove click mouseup mousedown keydown keypress keyup submit change mouseenter scroll resize dblclick', function () { //do_something 

});


Comments

Popular posts from this blog

How to connect android app to App engine -

gcc - MinGW's ld cannot perform PE operations on non PE output file -

php - display validation error message next to the textbox in codeigniter -