I want the browser to read a stream of numeric data (let's say, comma-separated integers) from an http-url on the server.
The stream is finite, but can be quite long, and I would like to start processing the data
in javascript (draw a html5/canvas/2d graph) incrementally as the data is received,
without waiting for end-of-stream before start drawing,
thus avoiding to hold the complete stream in browser's RAM.
And in a fashion that works on all major browsers, of course.
But how do I read the http-stream incrementally?
I figured this would be a quite common use-case, but still cannot easily google up a good example...
Can I do this with $.ajax() function?
If so, what event should I respond to, and
how do I read data from the partial, incomplete stream that has arrived so far?