Ajax call returning prematurily

S

Simon_21

Hi All,

Browser - IE 6.0
Server - Jboss 4.2.1 (Tomcat 6.0)

We are making call to the server using ajax to get some data. In a
worst case scenario the backend thread may take as long as 1 minute to
return. But sometimes what happens is I get the callback prematurily
saying that data is available. In other words,
onreadystatechange=function() gets triggered.

I debugged from the server side to see if the servlet (processing the
original request) is calling back and I don't see that happening.

I tried to use "new ActiveXObject('Msxml2.XMLHTTP.5.0').setTimeouts()"
to increase the timeout but it seems that call is not valid for the
client object.

Is there a way I can increase the time out.

Thanks
Rajesh
 
M

Martin Honnen

Simon_21 said:
We are making call to the server using ajax to get some data. In a
worst case scenario the backend thread may take as long as 1 minute to
return. But sometimes what happens is I get the callback prematurily
saying that data is available. In other words,
onreadystatechange=function() gets triggered.

Well check the readyState property for value 4 to ensure you process the
complete response.
 
S

Simon_21

Well check the readyState property for value 4 to ensure you process the
complete response.

Thanks for the reply.
I did check that unfortunately in both case it is 4. I also did a dump
of the getResponseHeaders() to see if there is a difference between
the legitimate repsonse and invalid one and unfortunately no luck.
 
T

Thomas 'PointedEars' Lahn

Simon_21 said:
Simon_21 said:
We are making call to the server using ajax to get some data. In a
worst case scenario the backend thread may take as long as 1 minute to
return. But sometimes what happens is I get the callback prematurily
saying that data is available. In other words,
onreadystatechange=function() gets triggered.
Well check the readyState property for value 4 to ensure you process the
complete response.
[...]

Please trim your quotes, and don't quote signatures unless you refer
explicitly to them.
Thanks for the reply.
I did check that unfortunately in both case it is 4. I also did a dump
of the getResponseHeaders() to see if there is a difference between
the legitimate repsonse and invalid one and unfortunately no luck.

Without your posting the relevant code snippet or the URL of a test case it
is impossible to say whether your assessment of the situation is correct.

http://www.jibbering.com/faq/faq_notes/clj_posts.html


PointedEars
 
M

Martin Honnen

Simon_21 said:
I did check that unfortunately in both case it is 4. I also did a dump
of the getResponseHeaders() to see if there is a difference between
the legitimate repsonse and invalid one and unfortunately no luck.

Does that happen with different browsers? Or just one particular browser?
 
S

Simon_21

Simon_21 wrote: [....]>
Does that happen with different browsers? Or just one particular browser?

It only happens with IE (actually 6.0 (tried with different
subversions and service packs), didn't try 7.0 as that is not a viable
option).

On Firefox, I was not able to reproduce this. If that is the case was
planning to use 'Firebug' to see what was actually going on. With IE
MS Script Editor doesn't seem to help much.

Thanks
Rajesh
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top