jquery - What is the difference between long and regular polling? -
Here, every 30 seconds , I make an AJAX call to update my DB I am Another question - if the server takes more than 30 seconds to give a negative feedback, what will be the negative side? Call sends another request to # 1, while Call # 1 is being updated - updating DB in latest value. long polling The AJAX call is sent, invites itself every 30 seconds, and once the call is completed it calls itself again, whereas it looks more synchronous, What if we send a call, at the end of 30 seconds (when I'm waiting to come back for the first time)? We now have the same "problem" that we had for the first time. Points in points of speech because I am waiting for a response from a former, because I do not really see any problems with sending an AJAX request Thank you! Tell me that this question was not clear. main problem: It is that you are not set timed out on AJAX requests yourself. It leaves it undefined, and as you can make a build-up, five requests are waiting for all the servers to respond and add every 30 seconds. This is not ideal because: set interval (even if it is incomplete with jQuery's full callback ,) Is not particularly wrong, but you need to set a timeout.
setInterval (function () {$ .ajax ({url: "server", success: function (data) {// update your dashboard gauge salegadget.Setview (data.value); }, Data type: "Jason"});}, 30000);
(function survey () {$ .ajax ({Url: "server", success: function (data) {// your dashboard gauge sales update PleaseGuage.setview (data.value);}, datatype: "Jason", complete: selection, timeout: 30000});}) ();
setInterval (function () {$ Ajax ({url: "server", success: function (data) {// update your dashboard gauge cellsgadget.setValue (data.value);}, datatype: "json"});}, 30000);
Comments
Post a Comment