Ajax polling is a technique used for checking for new server-side events.
Questions tagged [ajax-polling]
98 questions
3
votes
4 answers
Javascript Poll server. Will this cause a stack overflow?
I am not too familiar with the specifics of every javascript implementation on each browser. I do know however that using setTimeout, the method passed in gets called on a separate thread. So would using a setTimeout recursively inside of a method…
user19302
2
votes
1 answer
How to poll for status on client side
I need to find out status of an object which can change at any time. Best case scenario is if the object changes the client side gets updated, however I don't think there is plumbing for pushing updates to client-side without client-side asking for…

dev.e.loper
- 35,446
- 76
- 161
- 247
2
votes
2 answers
I want to execute a code in c# whenever a new row is inserted in the database
i am working on a chat application where the chat message from one client gets into the database and the other clients poll every 5 secs (using a timer) whether there is any new message or not, if yes, the messages are fetched and displayed. But…

Samarth
- 21
- 1
2
votes
1 answer
How to make a mysql query constantly refresh in PHP?
I'm making a basic chat room. My code:
$conn = ("127.0.0.1","root","","mymessages");
$stmt = "SELECT * FROM posts ORDER BY timestamp LIMIT 100";
$result = mysqli_query($conn, $stmt);
if(!$result) {
echo("Query failed" .…

YankueUser
- 23
- 4
2
votes
2 answers
jquery polling with smart poll plugin
I'm trying for the life of me to get this plugin to work but I'm not understanding the status function so retry is not firing.
$.poll(10000, function(retry){
$.get('willfail', function(response, status){
if (status == 'success') {
// Do…

ere
- 1,739
- 3
- 19
- 41
2
votes
1 answer
Long Ajax Request in Chrome Shows Waiting
In FF and IE, I make an Ajax request (Jquery Post) to my server. The requests calls a sql stored procedure which queries for 30 seconds before it returns data (or immediately if data is available). Data is then returned to my javascript and I…

Bob
- 3,074
- 11
- 43
- 62
2
votes
2 answers
Ajax polling: Doesn't display alert box [rails]
Implementing ajax polling following railscast ajax polling tutorial(#229). Alert box doesn't pop after running the sever.
app/views/quotes/index.js.erb:
alert('Hey');
QuotePoller.poll();
app/assets/javascrips/quotes.coffee:
@QuotePoller =
poll:…

niaS
- 323
- 4
- 18
2
votes
1 answer
Refresh/Redirect from backing bean when p:poll reaches certain condition
I'm implementing an auction system using jsf.
in the item page, I have a countdown showing how much time is left for this sale. I show it with .
the timeToEnd() method returns a string in the format: 1…

springer
- 31
- 6
2
votes
4 answers
ajax: don't wait for response, but check for it periodically
I have a PHP process that takes a long time to run. I don't want the AJAX process that calls it to wait for it to finish. When the PHP process finishes it will set a field in a database. There should be some kind of AJAX polling call to check on…

dnagirl
- 20,196
- 13
- 80
- 123
2
votes
2 answers
How to poll to WebMethod using Jquery/Javascript
Can anyone tell me about how to poll to webMethod on specific interval using Javascript/JQuery ? I tried setInterval & setTimeOut but non of them is working for me. My application generates reports on user's request. since the report generation is…

Mithun Ganatra
- 453
- 4
- 21
1
vote
0 answers
jQuery re-sending AJAX request?
I have a weird issue with an jQuery AJAX jQuery request. When we generate reports on our site, it can take a while, so we have a status bar that we update with polling. However, what I'm seeing is that these requests seem to be timing out and…

Seamus James
- 981
- 3
- 12
- 25
1
vote
1 answer
Polling with Javascript, but in different time intervals
I am using polling with Javascript to get some information with ajax but in exact the same time intervals.
intervalRequestId = setInterval('loadInfo()', 2500);
Because I know now, that the information is coming in different time intervals, I want…

Mutatos
- 1,675
- 4
- 25
- 55
1
vote
1 answer
Retry 5 times after ever 3 seconds once the document.hasFocus() return true
Angular 11: I have a requirement where my mobile website will take users to another apps' popup. Once the user comes back to my mobile website I have to make an HTTP GET call. If response.await===true or an error then after 3 seconds I have to try…

Naman Jain
- 61
- 7
1
vote
0 answers
How to implement polling in javascript
I want to get data from the server every one second. Suppose that I have data.json in the server. I want to fetch that file. Can I use the following code.
function getData(){
fetch('./data.json')
.then((result) => console.log(result))
…

Lalani Gunathilaka
- 77
- 8
1
vote
2 answers
Ajax polling vs SSE (performance on server side)
I'm curious about if there is some type of standard limit on when is better to use Ajax Polling instead of SSE, from a server side viewpoint.
1 request every second: I'm pretty sure is better SSE
1 request per minute: I'm pretty sure is better…

Enrique
- 4,693
- 5
- 51
- 71