I want to access AJAX data before the request has finished, effectively to implement streaming kind of like this:
ajax_request.send();
interval = setInterval(function() {
continueParsing(ajax_request.responseText);
if (download_complete)
clearInterval(interval);
}, 64);
Right now I have a php thingy to break the request up into smaller chunks, but I’d rather take it all in one go. What’s the best way to do this (I only care about Chrome and Firefox).
Well, starting with a PHP handler like this:
and a javascript like this:
I get this console:
so, it works…. i think you can figure out the rest 🙂