admin管理员组文章数量:1423068
Can I check if host page for a JavaScript is active by the browser's tab in IE7/FF/Opera?
Checking other tabs than the page where this JS runs would probably be a security risk though..
My other option is a method I remember by prototype to check if the mouse cursor is active, but it's not that accurate.
Can I check if host page for a JavaScript is active by the browser's tab in IE7/FF/Opera?
Checking other tabs than the page where this JS runs would probably be a security risk though..
My other option is a method I remember by prototype to check if the mouse cursor is active, but it's not that accurate.
Share Improve this question asked Feb 4, 2009 at 16:21 olemariusolemarius 1,1344 gold badges17 silver badges27 bronze badges 2- If it works for him, why wait? :-) – ceejayoz Commented Feb 4, 2009 at 18:04
- mainly wait as the guy who answered provided an answer to a different question. in this case, an accept was granted for saying what was said in the question. someone else can prove that wrong later, as happened in this case. – geowa4 Commented Feb 4, 2009 at 19:05
1 Answer
Reset to default 7You can attach the onBlur
and onFocus
events to the window
; that will tell you if you have focus or not. I have tested this and it works. You cannot check another page, but you can definitely check your own.
本文标签: Check browser tabs by JavaScriptStack Overflow
版权声明:本文标题:Check browser tabs by JavaScript? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744743236a2622734.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论