Skip to main content

Posts

Showing posts from January, 2018

Real-time Web Applications

Your application wants to show live data i.e. data sent from Server back up to the Client instead of the usual which is the Client sending data to the Server via a form submit. There are multiple options, currently the best option is WebSockets. Polling Periodically check the Server for updated data, uses SetInterval in Javascript. The Client sends some information to the Server and wants the Server to send back a response, the response is not immediate so the Client wants to wait for the Server but instead of waiting the Client keeps sending requests to the Server and when something is updated on the Server then the Client updates the UI. ( function poll (){ setTimeout ( function (){ $ . ajax ({ url : "server" , success : function ( data ){ //Update your dashboard gauge salesGauge . setValue ( data . value ); //Setup the next poll recursively poll (); }, dataType : "json" }); }, 30000 ); })(); https://...