Is there a reliable cross-browser way to detect that a tab has focus.  The scenario is that we have an application that polls regularly for stock prices, and if the page doesn't have focus we could stop the polling and save everyone the traffic...
What is best practise for polling server with JavaScript for application that needs to refresh data very rapidly? I'm using jQuery for front-end and Java Spring Framework for backend.  Example of refreshed data could be list of items that are g...
I'm a bit green, so please bear with me.  I need to poll a SharePoint webservice until it returns a value. I believe that I have formatted my code incorrectly. If there is a pre-existing thread that addresses this, please point me to it; my relat...
I’m trying to keep a Backbone.js Collection up-to-date with what’s happening on the server.  My code is similar to the following:  var Comment = Backbone.Model.extend({}); var CommentCollection = Backbone.Collection.extend({     model: Comment })...
I need to find a way to update a web App implemented with backbone.  The use case will be the following: I have several Views, and each View, or maybe model/collection related to this view, needs to make different polling request to the server at dif...
I'm trying to implement a WebSocket with a fallback to polling. If the WebSocket connection succeeds, readyState becomes 1, but if it fails, readyState is 3, and I should begin polling.  I tried something like this:  var socket = new WebSocket(ur...
I am trying to JSON.parse the array "data." I need to be able to pass the array as the root.  {   "data": [     {       "type": "name",       "id": "123"     }   ] }   The response should look like this...
I'm porting an existing program to nodejs. In this program, I open a file descriptor and then hand it off to a thread which calls poll on it in order to determine when it's readable.  Instead of writing a custom C++ module, I'd really lik...
I am writing a simple app that's very similar to a chat application in terms of its use.  A host starts a "room", participants can join and send messages into said room.  I am trying to make this as simple as possible to code.  PHP on the...
I have a page that changes hashes quite a bit, and I'm wanting to add the functionality that when the back/forward button is pressed (as in, the hash changes), a function runs. I've seen that you can do it with polling, but is that the only w...

Tags

Recent Questions

Top Questions

Home Tags Terms of Service Privacy Policy DMCA Contact Us

©2020 All rights reserved.