How to invoking js function on click browser tab?
I am looking this solution for invoking user when session gets expire.
Not getting any Solution. Please Help.
Asked
Active
Viewed 365 times
0

Himanshu
- 4,327
- 16
- 31
- 39

Shaharukh Qureshi
- 51
- 1
- 8
-
Probably something like this can help you: http://stackoverflow.com/questions/7389328/detect-if-browser-tab-has-focus – NDY Mar 13 '15 at 06:26
1 Answers
0
If you want to detect, that the browser tab with your page was clicked, when user was on aother tab, then you can use window.onfocus
window.onfocus = function() { alert('Browser tab clicked'); };

Timur Osadchiy
- 5,699
- 2
- 26
- 28