views:

277

answers:

2

Hi,

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.

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.

Thanks in Advance.

+1  A: 

the request is not going

How do you determine that?

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

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...

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

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

Nickolay
A: 

Hi

Thanks for the reply. Sorry for delay. I determined it by the tool WireShark.

No Iam using http protocol only. my url is http://IPaddress/?rqty=some-request-name. And Iam setting the request header as

httpObject.setRequestHeader("Content-Type","application/x-www-form-urlencoded");

is it still using non-Http Protocol?

Please help me out Iam not able to figure it out?

Thanks and Regards A Srinivas

In case you dont know, you can use comments to let the person replying know of your feedback rather than posting it as a separate answer.
shahkalpesh
So did you check the issue I google-linked to? You haven't indicated you did.Yes, from the looks of it you're using the HTTP protocol.I can only suggest you continue minimizing the problematic code until the problem becomes apparent.Perhaps the app does send the the request, but it gets handled by something at the OS level before getting to the network stack?I would also fire a debugger and look at the code - where readyState changes without sending a request, but only after trying everything else above.
Nickolay
grr, stupid stripping-paragraphs logic in comment formatting...
Nickolay