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'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 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...
I'd like to know how much polling will drain battery life. Is it dependent on the message size? Or is just the fact that I'm polling at all that makes it drain the batter?  I can provide more details:  Polling once every two seconds, and the...
I am trying to implement a simple "comet" ajax long-polling mechanism (as described here).  The problem is, I cannot figure out how to tell the browser to act as if it has finished loading the page, although it has a pending request running i...
I'm trying to figure out the best way for my client apps (angular) to have a callback (with data) triggered from a server event. My current scheme is this:   client app uploads a document (not a very frequent operation) regular rest server receiv...
I want to implement a system where my 'show' view, every 10 seconds will call update in the controller, then asynchronously updates the view without refreshing the page.   I have it at the point where it updates asynchronously. However I need...
I don't understand, how can long polling be helpfull at all if XMLHttpRequest gives no access to partial content???  There is no difference where to wait, on client, or on server. The responce can be shown only upon complete. So, both short polli...

Tags

Recent Questions

Top Questions

Home Tags Terms of Service Privacy Policy DMCA Contact Us

©2020 All rights reserved.