0

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.

Himanshu
  • 4,327
  • 16
  • 31
  • 39
  • 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 Answers1

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