最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

jquery - Javascript - Can javascript run while a browser tab is not in focus? - Stack Overflow

programmeradmin0浏览0评论

I for some JavaScript code that execute per second. However it doesn't seam to run if the tab it is loaded on isn't selected.

Is this my code or is Javascript not capable of does it?

Also, if Javascript can run when it's tab is not selected could someone help me with the code to determine with it's parent tab is select or not.

Answers can be in pure Javascript or JQuery and solution will only need to work in IE7+

Thank you in advance.

I'm working on get the some code for you to look at. Cheers.

Seams there was an error in the code. Thanks for the knowledge that javascript will run though.

I for some JavaScript code that execute per second. However it doesn't seam to run if the tab it is loaded on isn't selected.

Is this my code or is Javascript not capable of does it?

Also, if Javascript can run when it's tab is not selected could someone help me with the code to determine with it's parent tab is select or not.

Answers can be in pure Javascript or JQuery and solution will only need to work in IE7+

Thank you in advance.

I'm working on get the some code for you to look at. Cheers.

Seams there was an error in the code. Thanks for the knowledge that javascript will run though.

Share Improve this question edited Nov 8, 2010 at 12:28 Ash Burlaczenko asked Nov 8, 2010 at 11:27 Ash BurlaczenkoAsh Burlaczenko 25.5k16 gold badges69 silver badges101 bronze badges 1
  • perhaps you have an onBlur="stop processing" functionality ? – mplungjan Commented Nov 8, 2010 at 11:49
Add a ment  | 

2 Answers 2

Reset to default 5

Javascript should be running at the background. For browsers except Google Chrome, each tab is a thread and tabs should be able to municate with each other too. For the chrome case, since every tab is a process, you may need to use inter-process methods for munication.

If you could provide your code we would be more helpful.

JavaScript continues to run in the background. If it's not running, there should be some other reason. It would be helpful if you could give a code example to work with and work out what might not be happening.

发布评论

评论列表(0)

  1. 暂无评论