xmlhttprequest

Async Ajax streaming

Well, fnar.

 

I got my web-based Mac client builder working after wrestling with Roxen and Apache to convince one of them to send raw output without waiting for the CGI script to finish (Apache needed my CGI script to explicitly output a “Content-Encoding: chunked” header of it’s own). I’ve got my little status <div> updating on the fly by using setInterval to periodically check for new lines of text added to ajax.responseText. And it works under Safari and Firefox.

Apparently, though, IE doesn’t populate responseText until readyState == 4 and status == 200; if you try to access it before then you get a javascript error saying “The data necessary to complete this operation is not yet available”. Oh, well, networking remains one of Microsoft’s weakest areas. Maybe they’ll get compatible in a future version of XMLHttpRequest / XMLHTTP.