Loading external data
In a modern web application, it's a common task to load and reload data from external resources, regardless of whether we read from the database or plain text files. Thus, nearly every JavaScript framework includes its own functions to load external data, that is, in most of the cases a wrapper of the native XMLHttpRequest
(XHR) object. In our application setup, we have the following options to load external data:
XMLHttpRequest
: This is a native XHR object provided by most modern browsersd3.xhr()
: This is a wrapper function for theXMLHttpRequest
object in D3.js$http
: This is an Angular wrapper module for theXMLHttpRequest
object
These implementations use the unidirectional XMLHttpRequest
to request data from a web server. Unidirectional means that we can solely request data from the client and then wait for the response of the server. Thus, we also don't know if there is new data available on the server. If we want a "real-time-like" behavior, we will need to continuously...