检测使用JavaScript的浏览器标签的变化 [英] Detect change of browser tabs with javascript
本文介绍了检测使用JavaScript的浏览器标签的变化的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
有没有使用用户已切换到不同的标签在同一个浏览器窗口中的JavaScript检测某种方式。
is there some way of detecting using javascript that a user has switched to a different tab in the same browser window.
此外,有没有办法来检测用户已切换到不同的窗口不是浏览器?
Additionally is there a way to detect a user has switched to a different window than the browser?
感谢您
推荐答案
陷阱的 window.onblur
事件。
它提出只要当前窗口(或标签)失去焦点。
It's raised whenever the current window (or tab) loses focus.
这篇关于检测使用JavaScript的浏览器标签的变化的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文