views:

32

answers:

1

Hi Folks,

I'm playing around with some comet and mxhr technologys. As it turns out, Chrome (5) does actually fire a readystate 3, but the responseText is always empty there.

Until today I though only InternetExplorers (<8) would show that behavior.

Am I wrong here?

Can somebody confirm that Chrome does not fully support ajax readystate 3 ?

A: 

After doing a lot of research and reading in webkits developer forum, I finally can tell what is happening and how to prevent that in chrome / webkit / safari.

It's all about the connection type. To make chrome work "correctly" (responseText is NOT null) within ready state 3, we need a content-type which is not subject to sniffing. For instance a Content-type: text/xml works fine.

Another important thing on webkit is that it does not render pushed data until there are enough bytes transfered. "Official" that treshhold is about 256 bytes. So you have to at least send that as a padding.

Anyways on my testing I figured that you need to send a whole lot more before Chrome(5) fires a state3 ajax event the first time. Around 1kb.

jAndy