Questions tagged [ajax-polling]

Ajax polling is a technique used for checking for new server-side events.

93 questions
62
votes
2 answers

Server-Sent Events vs Polling

Is there a big difference (in terms of performance, browser implementation availability, server load etc) between HTML5 SSEs and straight up Ajax polling? From the server side, it seems like an EventSource is just hitting the specified page every ~3…
25
votes
10 answers

How to implement a chat room using Jquery/PHP?

I'm looking to implement a chat room using PHP/Javascript (Jquery) with both group chat and private chat features. The problem is how to continually update the interface in a natural way and possibly also how to show 'X is typing..' messages in…
Click Upvote
  • 235,452
  • 251
  • 553
  • 736
14
votes
3 answers

Make AngularJS skip running a digest loop if $http.get() resulted in no new data

I'm currently polling the server to check for new data, and then update the model in an AngularJS app accordingly. He're roughly what I'm doing: setInterval(function () { $http.get('data.json').then(function (result) { if…
Strille
  • 5,396
  • 2
  • 21
  • 38
9
votes
3 answers

Reduce AJAX request size. Simple chat with Polling system

NOTICE: I replaced my polling system with websockets but I still want to know the answer to my questions above. I'm trying to reduce an AJAX request of a traditional-polling message system, but I don't know how to get it: $chatbox =…
tomloprod
  • 6,070
  • 5
  • 41
  • 61
7
votes
1 answer

AJAX/Reverse AJAX: Polling or Push?

Been studying a ton on AJAX because I'm making a real-time application out of Javascript and PHP. It needs to be able to update without refreshing the page and in real-time. I tried polling the server with setInterval() but for it to be quick I had…
Tyler Hughes
  • 552
  • 1
  • 9
  • 19
6
votes
3 answers

AJAX Polling Question - Blocking Or Frequent?

I have a web application that relies on very "live" data - so it needs an update every 1 second if something has changed. I was wondering what the pros and cons of the following solutions are. Solution 1 - Poll A Lot So every 1 second, I send a…
Fenton
  • 206,497
  • 63
  • 356
  • 369
6
votes
2 answers

Ngrx Store, Effects, Http Ajax Polling Setup on Angular 2

I'm creating an Ngrx Angular 2 app and was trying to get my http calls to continue polling after a time interval. I have seen the use of the interval() function, but in case of Ngrx, when service calls are done inside @Effect(), it gives an error.…
notANerdDev
  • 1,204
  • 11
  • 25
5
votes
3 answers

jQuery recursive ajax poll using setTimeout to control the poll interval

$(document).ready(function() { (function poll() { setTimeout(function() { $.ajax({ url: "/project1/api/getAllUsers", type: "GET", success: function(data) { …
chrisjleu
  • 4,085
  • 5
  • 39
  • 55
4
votes
1 answer

User Presence In a chat room (chat getting updated by simple polling)

We have implemented a simple chat room feature in Rails using Simple Ajax updates. Now in every chat room a message belongs to particular user. We want to show the list of users(something like user presence). Please suggest ways. We are not using…
Arc
  • 1,580
  • 5
  • 29
  • 53
3
votes
2 answers

How to Use Long Polling or Ajax Push in your Website

I want to know how to use ajax push . i have learnt from various Web articles that Ajax push can be obtained by using few programmes like COMET, APE (AJAX PUSH ENGINE) etc.... But i want to know whether there is a simpler way of using it and what…
Samir
  • 269
  • 3
  • 6
  • 12
3
votes
5 answers

AJAX/PHP Why is HTTP-Polling so laggy?

Why is HTTP-Polling so laggy? What I have is a button, and whenever a user clicks it a MySQL database field gets updated and the value is displayed to the user. I'm polling every 800 milliseconds and it's very laggy/glitchy. Sometimes when clicking…
clbembry
  • 33
  • 2
3
votes
3 answers

Long Polling or full-duplex connection? Where is the catch?

I'm implementing a messaging system with long poll to have real time updates for my users. Doing so I noticed that some websites such as Hotmail use also xhr requests but they seem to be a little different from the one I have implemented. As you…
franks
  • 61
  • 1
  • 9
3
votes
2 answers

Polling not working in React JS mixin

So I created the following mixin: var Polling = { startPolling: function() { var self = this; setTimeout(function() { self.poll(); if (!self.isMounted()) { return; } …
TheWebs
  • 10,087
  • 21
  • 77
  • 164
3
votes
1 answer

close long poll connection, jQuery-ajax

Background I use a Tornado-like server with support for long-polls. Each new web page a user comes to sets up a long poll to the server like this: $.ajax({ type: 'GET', url: "/mylongpollurl/", dataType: 'application/json', success:…
MyGGaN
  • 1,670
  • 3
  • 30
  • 40
3
votes
1 answer

javascript doesn't seem to be getting data from rails source

I am using dataTables to display a nice table to display various information. The javascript successfully sends poll requests to the database/webserver, however the javascript doesn't seem to be getting any current data. Here is my controller class…
Pinpin
  • 83
  • 1
  • 9
1
2 3 4 5 6 7