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.

2 Comments

Don’t bet on it. They’ll come up with their own way and demand everyone to switch. Oh, and you’ll also have to use MS web server to fully comply. ;)

Hater!

/runs

Leave a Reply

Name and email address are required. Your email address will not be published.

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

You may use these HTML tags and attributes:

<a href="" title="" rel=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <pre> <q cite=""> <s> <strike> <strong> 

%d bloggers like this: