Check browser tabs by JavaScript? - Stack Overflow

Can I check if host page for a JavaScript is active by the browser's tab in IE7FFOpera? Checking

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
Add a ment  | 

1 Answer 1

Reset to default 7

You 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.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744743236a4591153.html

相关推荐

  • Check browser tabs by JavaScript? - Stack Overflow

    Can I check if host page for a JavaScript is active by the browser's tab in IE7FFOpera? Checking

    1天前
    30

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信