阿贾克斯的readyState 3(浏览器/ IE浏览器) [英] Ajax readystate 3 (Chrome / IE)

查看:179
本文介绍了阿贾克斯的readyState 3(浏览器/ IE浏览器)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在玩弄一些彗星 mxhr technologys。事实证明,铬(5)并真正火了 readystate为3 ,而 responseText的总是有。

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.

直到今天我还以为只有 InternetExplorers (小于8),将显示该行为。

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

我错了吗?

有人可以证实, Chrome浏览器不完全支持 AJAX readystate为3

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

推荐答案

做了很多的研究,阅读 webkits 开发者论坛后,我终于可以告诉发生了什么以及如何prevent,在铬/ WebKit的/ Safari浏览器

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.

这是所有关于连接类型。为了让工作正常(responseText的IS NOT NULL)在就绪状态3 ,我们需要的内容类型这是不受嗅探。例如,一个内容类型:文本/ xml的正常工作

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.

的WebKit 另一个重要的事情是,它并没有呈现推数据,直到有足够的转移字节。 官方的 treshhold 大约是256个字节。所以,你必须至少发送一个空白。

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.

反正在我的测试中,我想通了,你需要在送了一大堆更多的Chrome(5)触发一个STATE3 AJAX事件的第一次。 1KB左右。

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.

这篇关于阿贾克斯的readyState 3(浏览器/ IE浏览器)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆