XMLHttpRequest 问题 [英] XMLHttpRequest problem

查看:44
本文介绍了XMLHttpRequest 问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 XUL 编写一个 Web 应用程序.在那个我使用 AJAX XMLHttpRequest 对象向服务器发送请求.当我使用 GPRS 连接将请求从我的 Web 应用程序发送到服务器时,请求没有进行,但 readyState 已更改为 4 且 status=0.如果请求没有发出,readyState 是如何变化的.

I am writing one Web Application using XUL. In that Iam using AJAX XMLHttpRequest Object for sending request to server. When I use GPRS connection to send the request to the server from my web application the request is not going, but readyState has changed to 4 and status=0. If the request is not going out how the readyState is Changing.

相同的代码在本地网络中运行良好.如果我使用 GPRS 从浏览器向服务器发送请求,则它工作正常.任何机构都可以帮助我解决这个问题.

The same Code working fine in local network. If I send the request to server from the browser using GPRS it is working fine. Can any body help me out in solving this problem.

提前致谢.

推荐答案

请求不进行

你如何确定?

您使用 HTTP 方案吗?如果是这样,则 status == 0 是一个问题,(google 说 Firefox 中有一些已知的怪癖.

Do you use the HTTP scheme? If so, status == 0 is an issue, (google says there are known quirks in Firefox).

status == 0 当请求使用非 HTTP 协议时也会返回.因此,如果您不小心发出 file://请求,它将解释所有症状...

status == 0 is also returned when the request is using a non-HTTP protocol. So if you're making a file:// request accidentally, it would explain all the symptoms...

还发现了这个问题:https://bugzilla.mozilla.org/show_bug.cgi?id=488605自 Firefox 3 起,中止的 XMLHttpRequest 的状态为==0.

[edit 2009-09-07] Also found this issue: https://bugzilla.mozilla.org/show_bug.cgi?id=488605 aborted XMLHttpRequests have status==0 since Firefox 3.

[edit] 我不确定/非常/,但我认为不允许的跨域请求也会以 status == 0 结束.

[edit] I'm not /quite/ sure, but I think that cross-domain requests that are not allowed also end up with status == 0.

这篇关于XMLHttpRequest 问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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